Uploaded image for project: 'Jackrabbit Oak'
  1. Jackrabbit Oak
  2. OAK-9665

Unparseable date property causes entire node to fail indexing

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Major
    • Resolution: Fixed
    • None
    • 1.44.0
    • elastic-search, indexing
    • 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

          Activity

            People

              ngupta Nitin Gupta
              thomasm Thomas Mueller
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: