Uploaded image for project: 'Hibernate Search'
  1. HSEARCH-1936

Avro Serializer does not preserve value of field's term vector when it is set to YES

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 5.4.0.CR1
    • Fix Version/s: 5.4.0.CR2
    • Component/s: serialization
    • Labels:
      None

      Description

      Hello,

      When serializing / deserializing an AddLuceneWork with the Avro serializer on a document containing a field type with term vector = YES, the resulting field type is not equal to the original one: the storeTermVectorPayloads attribute is set to true but was originally false.

      Attached is the org.hibernate.search.test.serialization.SerializationTest unit test taken from github where I added a new field

      Field newField = new Field(
      				"StringTermYes",
      				"String field 3",
      				Store.YES,
      				Field.Index.ANALYZED,
      				Field.TermVector.YES);
      

      When used in a real-life scenario (like JMS replication), this leads to the following Lucene error:

      java.lang.IllegalArgumentException: cannot index term vector payloads without term vector positions (field="x_id_lowercase_copy")
              at org.apache.lucene.index.TermVectorsConsumerPerField.start(TermVectorsConsumerPerField.java:147)
              at org.apache.lucene.index.TermsHashPerField.start(TermsHashPerField.java:297)
              at org.apache.lucene.index.FreqProxTermsWriterPerField.start(FreqProxTermsWriterPerField.java:72)
              at org.apache.lucene.index.DefaultIndexingChain$PerField.invert(DefaultIndexingChain.java:616)
              at org.apache.lucene.index.DefaultIndexingChain.processField(DefaultIndexingChain.java:359)
              at org.apache.lucene.index.DefaultIndexingChain.processDocument(DefaultIndexingChain.java:318)
              at org.apache.lucene.index.DocumentsWriterPerThread.updateDocument(DocumentsWriterPerThread.java:239)
              at org.apache.lucene.index.DocumentsWriter.updateDocument(DocumentsWriter.java:457)
              at org.apache.lucene.index.IndexWriter.updateDocument(IndexWriter.java:1511)
              at org.apache.lucene.index.IndexWriter.addDocument(IndexWriter.java:1246)
              at org.hibernate.search.backend.impl.lucene.works.AddWorkDelegate.performWork(AddWorkDelegate.java:54)
              at org.hibernate.search.backend.impl.lucene.LuceneBackendQueueTask.performWork(LuceneBackendQueueTask.java:111)
              at org.hibernate.search.backend.impl.lucene.LuceneBackendQueueTask.applyUpdates(LuceneBackendQueueTask.java:92)
              at org.hibernate.search.backend.impl.lucene.LuceneBackendQueueTask.run(LuceneBackendQueueTask.java:47)
              at org.hibernate.search.backend.impl.lucene.SyncWorkProcessor$Consumer.applyChangesets(SyncWorkProcessor.java:145)
              at org.hibernate.search.backend.impl.lucene.SyncWorkProcessor$Consumer.run(SyncWorkProcessor.java:135)
              at java.lang.Thread.run(Thread.java:745)
      

      Thanks

      Benoit

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              bguillon Benoit Guillon
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: