Details
-
Improvement
-
Status: Closed
-
Major
-
Resolution: Fixed
-
None
-
None
Description
If the index definition defines a property as a Date, but the value is not in the appropriate Date format, then indexing will (partially) fail.
The behaviour in this situation is different between Lucene and Elastic:
- With a Lucene index, WARN [1] is logged but the rest is indexed.
- With Elastic index, ERROR [2] is logged and no document is created.
[1]
Ignoring ordered property. Could not convert property ... of type STRING to type DATE for path ... java.lang.NullPointerException: null at org.apache.jackrabbit.oak.plugins.index.lucene.FieldFactory.dateToLong(FieldFactory.java:186) [org.apache.jackrabbit.oak-lucene:1.8.24] at org.apache.jackrabbit.oak.plugins.index.lucene.LuceneDocumentMaker.addTypedOrderedFields(LuceneDocumentMaker.java:385) [org.apache.jackrabbit.oak-lucene:1.8.24] at org.apache.jackrabbit.oak.plugins.index.lucene.LuceneDocumentMaker.access$100(LuceneDocumentMaker.java:67) [org.apache.jackrabbit.oak-lucene:1.8.24] at org.apache.jackrabbit.oak.plugins.index.lucene.LuceneDocumentMaker$1.onResult(LuceneDocumentMaker.java:590) [org.apache.jackrabbit.oak-lucene:1.8.24] at org.apache.jackrabbit.oak.plugins.index.lucene.Aggregate$PropertyInclude.collectResults(Aggregate.java:396) [org.apache.jackrabbit.oak-lucene:1.8.24]
[2]
00:49:19.521 [I/O dispatcher 1] ERROR o.a.j.o.p.i.e.i.ElasticBulkProcessorHandler - Failure Details: BulkItem ID: ..., Failure Cause: {} org.elasticsearch.ElasticsearchException: Elasticsearch exception [type=mapper_parsing_exception, reason=failed to parse field [...] of type [date] in document with id '...'. Preview of field's value: '2021-09-01 00:01'] at org.elasticsearch.ElasticsearchException.innerFromXContent(ElasticsearchException.java:496) at org.elasticsearch.ElasticsearchException.fromXContent(ElasticsearchException.java:407) at org.elasticsearch.action.bulk.BulkItemResponse.fromXContent(BulkItemResponse.java:139) at org.elasticsearch.action.bulk.BulkResponse.fromXContent(BulkResponse.java:188) at org.elasticsearch.client.RestHighLevelClient.parseEntity(RestHighLevelClient.java:1911)
Attachments
Issue Links
- links to