java.lang.IllegalArgumentException: DocValuesField "tags.iid" appears more than once in this document (only one value is allowed per field)

Hibernate JIRA | Ashot Golovenko | 1 year ago
  1. 0

    I have a Phrase entity with multiple Tags. {code:title=Phrase.java|borderStyle=solid} @ManyToMany(fetch = FetchType.LAZY) @JoinTable(name = "phrase_tag", joinColumns = @JoinColumn(name = "phrase_id", referencedColumnName = "id"), inverseJoinColumns = @JoinColumn(name = "tag_id", referencedColumnName = "id")) @IndexedEmbedded(includeEmbeddedObjectId = false) public Set<Tag> getTags() { return tags; } {code} The only indexed field in Tag is iid: {code:title=Tag.java|borderStyle=solid} @Transient @Facet(forField = "iid") @Field(name = "iid", index = Index.YES, analyze = Analyze.NO) public Long getIndexingId(){ return getId(); } {code} Adding a {{@Facet}} annotation to mapping results in the following exception while indexing: {code} org.hibernate.search.exception.impl.LogErrorHandler - HSEARCH000058: HSEARCH000183: Unable to index instance of type com.phrask.model.phrase.Phrase while batch indexing: id=33, hashCode=33 java.lang.IllegalArgumentException: DocValuesField "tags.iid" appears more than once in this document (only one value is allowed per field) at org.apache.lucene.index.NumericDocValuesWriter.addValue(NumericDocValuesWriter.java:54) at org.apache.lucene.index.DefaultIndexingChain.indexDocValue(DefaultIndexingChain.java:438) at org.apache.lucene.index.DefaultIndexingChain.processField(DefaultIndexingChain.java:392) at org.apache.lucene.index.DefaultIndexingChain.processDocument(DefaultIndexingChain.java:318) at org.apache.lucene.index.DocumentsWriterPerThread.updateDocument(DocumentsWriterPerThread.java:241) at org.apache.lucene.index.DocumentsWriter.updateDocument(DocumentsWriter.java:465) at org.apache.lucene.index.IndexWriter.updateDocument(IndexWriter.java:1526) at org.apache.lucene.index.IndexWriter.addDocument(IndexWriter.java:1252) at org.hibernate.search.backend.impl.lucene.works.AddWorkExecutor.performWork(AddWorkExecutor.java:54) at org.hibernate.search.backend.impl.lucene.LuceneBackendTaskStreamer.doWork(LuceneBackendTaskStreamer.java:53) at org.hibernate.search.backend.impl.lucene.LuceneBackendQueueProcessor.applyStreamWork(LuceneBackendQueueProcessor.java:76) at org.hibernate.search.indexes.spi.DirectoryBasedIndexManager.performStreamOperation(DirectoryBasedIndexManager.java:107) at org.hibernate.search.backend.impl.StreamingOperationExecutorSelector$AddSelectionExecutor.performStreamOperation(StreamingOperationExecutorSelector.java:106) at org.hibernate.search.backend.impl.batch.DefaultBatchBackend.sendWorkToShards(DefaultBatchBackend.java:62) at org.hibernate.search.backend.impl.batch.DefaultBatchBackend.enqueueAsyncWork(DefaultBatchBackend.java:48) at org.hibernate.search.batchindexing.impl.IdentifierConsumerDocumentProducer.index(IdentifierConsumerDocumentProducer.java:263) at org.hibernate.search.batchindexing.impl.IdentifierConsumerDocumentProducer.indexAllQueue(IdentifierConsumerDocumentProducer.java:192) at org.hibernate.search.batchindexing.impl.IdentifierConsumerDocumentProducer.loadList(IdentifierConsumerDocumentProducer.java:169) at org.hibernate.search.batchindexing.impl.IdentifierConsumerDocumentProducer.loadAllFromQueue(IdentifierConsumerDocumentProducer.java:135) at org.hibernate.search.batchindexing.impl.IdentifierConsumerDocumentProducer.run(IdentifierConsumerDocumentProducer.java:108) at org.hibernate.search.batchindexing.impl.OptionallyWrapInJTATransaction.runWithErrorHandler(OptionallyWrapInJTATransaction.java:104) at org.hibernate.search.batchindexing.impl.ErrorHandledRunnable.run(ErrorHandledRunnable.java:32) at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) at java.util.concurrent.FutureTask.run(FutureTask.java:266) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) at java.lang.Thread.run(Thread.java:745) {code} Removing {{@Facet}} annotation removes the exception along with ability for faceting on tag Ids. I didn't find any evidence that faceting over multi value fields is deprecated in {{5.3.0.Final}} so it makes me think that it's a bug.

    Hibernate JIRA | 1 year ago | Ashot Golovenko
    java.lang.IllegalArgumentException: DocValuesField "tags.iid" appears more than once in this document (only one value is allowed per field)
  2. 0

    I have a Phrase entity with multiple Tags. {code:title=Phrase.java|borderStyle=solid} @ManyToMany(fetch = FetchType.LAZY) @JoinTable(name = "phrase_tag", joinColumns = @JoinColumn(name = "phrase_id", referencedColumnName = "id"), inverseJoinColumns = @JoinColumn(name = "tag_id", referencedColumnName = "id")) @IndexedEmbedded(includeEmbeddedObjectId = false) public Set<Tag> getTags() { return tags; } {code} The only indexed field in Tag is iid: {code:title=Tag.java|borderStyle=solid} @Transient @Facet(forField = "iid") @Field(name = "iid", index = Index.YES, analyze = Analyze.NO) public Long getIndexingId(){ return getId(); } {code} Adding a {{@Facet}} annotation to mapping results in the following exception while indexing: {code} org.hibernate.search.exception.impl.LogErrorHandler - HSEARCH000058: HSEARCH000183: Unable to index instance of type com.phrask.model.phrase.Phrase while batch indexing: id=33, hashCode=33 java.lang.IllegalArgumentException: DocValuesField "tags.iid" appears more than once in this document (only one value is allowed per field) at org.apache.lucene.index.NumericDocValuesWriter.addValue(NumericDocValuesWriter.java:54) at org.apache.lucene.index.DefaultIndexingChain.indexDocValue(DefaultIndexingChain.java:438) at org.apache.lucene.index.DefaultIndexingChain.processField(DefaultIndexingChain.java:392) at org.apache.lucene.index.DefaultIndexingChain.processDocument(DefaultIndexingChain.java:318) at org.apache.lucene.index.DocumentsWriterPerThread.updateDocument(DocumentsWriterPerThread.java:241) at org.apache.lucene.index.DocumentsWriter.updateDocument(DocumentsWriter.java:465) at org.apache.lucene.index.IndexWriter.updateDocument(IndexWriter.java:1526) at org.apache.lucene.index.IndexWriter.addDocument(IndexWriter.java:1252) at org.hibernate.search.backend.impl.lucene.works.AddWorkExecutor.performWork(AddWorkExecutor.java:54) at org.hibernate.search.backend.impl.lucene.LuceneBackendTaskStreamer.doWork(LuceneBackendTaskStreamer.java:53) at org.hibernate.search.backend.impl.lucene.LuceneBackendQueueProcessor.applyStreamWork(LuceneBackendQueueProcessor.java:76) at org.hibernate.search.indexes.spi.DirectoryBasedIndexManager.performStreamOperation(DirectoryBasedIndexManager.java:107) at org.hibernate.search.backend.impl.StreamingOperationExecutorSelector$AddSelectionExecutor.performStreamOperation(StreamingOperationExecutorSelector.java:106) at org.hibernate.search.backend.impl.batch.DefaultBatchBackend.sendWorkToShards(DefaultBatchBackend.java:62) at org.hibernate.search.backend.impl.batch.DefaultBatchBackend.enqueueAsyncWork(DefaultBatchBackend.java:48) at org.hibernate.search.batchindexing.impl.IdentifierConsumerDocumentProducer.index(IdentifierConsumerDocumentProducer.java:263) at org.hibernate.search.batchindexing.impl.IdentifierConsumerDocumentProducer.indexAllQueue(IdentifierConsumerDocumentProducer.java:192) at org.hibernate.search.batchindexing.impl.IdentifierConsumerDocumentProducer.loadList(IdentifierConsumerDocumentProducer.java:169) at org.hibernate.search.batchindexing.impl.IdentifierConsumerDocumentProducer.loadAllFromQueue(IdentifierConsumerDocumentProducer.java:135) at org.hibernate.search.batchindexing.impl.IdentifierConsumerDocumentProducer.run(IdentifierConsumerDocumentProducer.java:108) at org.hibernate.search.batchindexing.impl.OptionallyWrapInJTATransaction.runWithErrorHandler(OptionallyWrapInJTATransaction.java:104) at org.hibernate.search.batchindexing.impl.ErrorHandledRunnable.run(ErrorHandledRunnable.java:32) at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) at java.util.concurrent.FutureTask.run(FutureTask.java:266) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) at java.lang.Thread.run(Thread.java:745) {code} Removing {{@Facet}} annotation removes the exception along with ability for faceting on tag Ids. I didn't find any evidence that faceting over multi value fields is deprecated in {{5.3.0.Final}} so it makes me think that it's a bug.

    Hibernate JIRA | 1 year ago | Ashot Golovenko
    java.lang.IllegalArgumentException: DocValuesField "tags.iid" appears more than once in this document (only one value is allowed per field)
  3. 0

    Strange exception in Elasticsearch 1.4.3

    Google Groups | 2 years ago | Angel Cross
    java.lang.IllegalArgumentException: State contains AttributeImpl of type org.apache.lucene.analysis.tokenattributes.PayloadAttributeImpl that is not in in this AttributeSource
  4. Speed up your debug routine!

    Automated exception search integrated into your IDE

  5. 0

    cluster can't recover after upgrade from 1.1.1 to 1.3.2 due to MaxBytesLengthExceededException

    Google Groups | 2 years ago | omar
    org.elasticsearch.index.gateway.IndexShardGatewayRecoveryException: [transient_2014_09_10][7] failed to recover shard
  6. 0

    How to correctly implement a delegating tokenizer in lucene 4.x?

    Stack Overflow | 2 years ago | user3159253
    java.lang.IllegalArgumentException: first position increment must be > 0 (got 0) for field 'address' at org.apache.lucene.index.DefaultIndexingChain$PerField.invert(DefaultIndexingChain.java:617)

  1. tyson925 3 times, last 4 months ago
2 unregistered visitors
Not finding the right solution?
Take a tour to get the most out of Samebug.

Tired of useless tips?

Automated exception search integrated into your IDE

Root Cause Analysis

  1. java.lang.IllegalArgumentException

    DocValuesField "tags.iid" appears more than once in this document (only one value is allowed per field)

    at org.apache.lucene.index.NumericDocValuesWriter.addValue()
  2. Lucene
    IndexWriter.addDocument
    1. org.apache.lucene.index.NumericDocValuesWriter.addValue(NumericDocValuesWriter.java:54)
    2. org.apache.lucene.index.DefaultIndexingChain.indexDocValue(DefaultIndexingChain.java:438)
    3. org.apache.lucene.index.DefaultIndexingChain.processField(DefaultIndexingChain.java:392)
    4. org.apache.lucene.index.DefaultIndexingChain.processDocument(DefaultIndexingChain.java:318)
    5. org.apache.lucene.index.DocumentsWriterPerThread.updateDocument(DocumentsWriterPerThread.java:241)
    6. org.apache.lucene.index.DocumentsWriter.updateDocument(DocumentsWriter.java:465)
    7. org.apache.lucene.index.IndexWriter.updateDocument(IndexWriter.java:1526)
    8. org.apache.lucene.index.IndexWriter.addDocument(IndexWriter.java:1252)
    8 frames
  3. Hibernate Search Engine
    ErrorHandledRunnable.run
    1. org.hibernate.search.backend.impl.lucene.works.AddWorkExecutor.performWork(AddWorkExecutor.java:54)
    2. org.hibernate.search.backend.impl.lucene.LuceneBackendTaskStreamer.doWork(LuceneBackendTaskStreamer.java:53)
    3. org.hibernate.search.backend.impl.lucene.LuceneBackendQueueProcessor.applyStreamWork(LuceneBackendQueueProcessor.java:76)
    4. org.hibernate.search.indexes.spi.DirectoryBasedIndexManager.performStreamOperation(DirectoryBasedIndexManager.java:107)
    5. org.hibernate.search.backend.impl.StreamingOperationExecutorSelector$AddSelectionExecutor.performStreamOperation(StreamingOperationExecutorSelector.java:106)
    6. org.hibernate.search.backend.impl.batch.DefaultBatchBackend.sendWorkToShards(DefaultBatchBackend.java:62)
    7. org.hibernate.search.backend.impl.batch.DefaultBatchBackend.enqueueAsyncWork(DefaultBatchBackend.java:48)
    8. org.hibernate.search.batchindexing.impl.IdentifierConsumerDocumentProducer.index(IdentifierConsumerDocumentProducer.java:263)
    9. org.hibernate.search.batchindexing.impl.IdentifierConsumerDocumentProducer.indexAllQueue(IdentifierConsumerDocumentProducer.java:192)
    10. org.hibernate.search.batchindexing.impl.IdentifierConsumerDocumentProducer.loadList(IdentifierConsumerDocumentProducer.java:169)
    11. org.hibernate.search.batchindexing.impl.IdentifierConsumerDocumentProducer.loadAllFromQueue(IdentifierConsumerDocumentProducer.java:135)
    12. org.hibernate.search.batchindexing.impl.IdentifierConsumerDocumentProducer.run(IdentifierConsumerDocumentProducer.java:108)
    13. org.hibernate.search.batchindexing.impl.OptionallyWrapInJTATransaction.runWithErrorHandler(OptionallyWrapInJTATransaction.java:104)
    14. org.hibernate.search.batchindexing.impl.ErrorHandledRunnable.run(ErrorHandledRunnable.java:32)
    14 frames
  4. Java RT
    Thread.run
    1. java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
    2. java.util.concurrent.FutureTask.run(FutureTask.java:266)
    3. java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
    4. java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
    5. java.lang.Thread.run(Thread.java:745)
    5 frames