I\'ve this issue in my project. I read my .xlsx excel file using Apache Poi and I want to index them in my Solr core. I use SolrInputDocument to index reading file. Here is my j
You probably have in your schema a field set as the unique key like this:
<uniqueKey>id</uniqueKey>
The problem is that when you upload a doc, in this case via Apache POI, you are not sending a value for that unique field.
You have a couple options:
<copyField source="excel_guaranteed_unique" dest="id"/>
As you have the actual document, you could just add a UUID to the "id" field.
Create a unique field like a UUID updating your RequestHandlder, like this:
<updateRequestProcessorChain name="uuid" >
<processor class="solr.UUIDUpdateProcessorFactory">
<str name="fieldName">id</str>
</processor>
...
</updateRequestProcessorChain>
...
<requestHandler name="/update" class="solr.UpdateRequestHandler">
<lst name="defaults">
<str name="update.chain">uuid</str>
</lst>
</requestHandler>
You also need to update the extract handler:
<requestHandler name="/update/extract"
startup="lazy"
class="solr.extraction.ExtractingRequestHandler" >
<lst name="defaults">
...
<str name="update.chain">uuid</str>
</lst>