With Jira 7 we indexed references to issues in the following way:
{id: [1, 2, 3]}
in issue properties. And we then had a indexing configuration like this:
<index-document-configuration entity-key="IssueProperty" key="atlas-crm-issue-entity-property">
<key property-key="atlas_crm_entity">
<extract path="id" type="number" alias="atlasReference"/>
</key>
</index-document-configuration>
We are coming from cloud and there this way of indexing arrays also works. But when we started testing on Jira 8 we noticed the following exception:
2019-03-14 12:37:35,513 http-nio-8080-exec-4 WARN admin 757x8030x1 vnxrua 95.97.91.91,10.0.150.186 /plugins/servlet/atlas-crm/api [c.a.jira.index.AccumulatingResultBuilder] DocValuesField "ISSUEPROP_atlas_crm_entity$id" appears more than once in this document (only one value is allowed per field)
java.lang.IllegalArgumentException: DocValuesField "ISSUEPROP_atlas_crm_entity$id" appears more than once in this document (only one value is allowed per field)
at org.apache.lucene.index.SortedDocValuesWriter.addValue(SortedDocValuesWriter.java:67)
at org.apache.lucene.index.DefaultIndexingChain.indexDocValue(DefaultIndexingChain.java:550)
at org.apache.lucene.index.DefaultIndexingChain.processField(DefaultIndexingChain.java:466)
at org.apache.lucene.index.DefaultIndexingChain.processDocument(DefaultIndexingChain.java:392)
at org.apache.lucene.index.DocumentsWriterPerThread.updateDocument(DocumentsWriterPerThread.java:240)
at org.apache.lucene.index.DocumentsWriter.updateDocument(DocumentsWriter.java:497)
at org.apache.lucene.index.IndexWriter.updateDocument(IndexWriter.java:1729)
at com.atlassian.jira.index.WriterWrapper.updateDocuments(WriterWrapper.java:85)
at com.atlassian.jira.index.Operations$Update.perform(Operations.java:169)
at com.atlassian.jira.index.Operations$Completion.perform(Operations.java:267)
at com.atlassian.jira.index.QueueingIndex$CompositeOperation.perform(QueueingIndex.java:187)
at com.atlassian.jira.index.DefaultIndexEngine$FlushPolicy.perform(DefaultIndexEngine.java:76)
at com.atlassian.jira.index.DefaultIndexEngine.write(DefaultIndexEngine.java:138)
at com.atlassian.jira.index.DefaultIndex.perform(DefaultIndex.java:28)
at com.atlassian.jira.index.QueueingIndex$Task.perform(QueueingIndex.java:132)
at com.atlassian.jira.index.QueueingIndex$Task.index(QueueingIndex.java:144)
at com.atlassian.jira.index.QueueingIndex$Task.run(QueueingIndex.java:111)
at java.lang.Thread.run(Thread.java:748)
Any ideas how we could solve this issue? I am not sure if this is a bug (but it worked with Jira 7) or if we should do this another way (which would suck because this would make it harder for our users to migrate between jira-server and jira-cloud…