While Importing the data into Solr using DataImportHandler, I am getting the below error. Please someone provide your suggestion.
org.apache.solr.common.SolrException: Document is missing mandatory uniqueKey field: id
at org.apache.solr.update.AddUpdateCommand.getIndexedId(AddUpdateCommand.java:92)
at org.apache.solr.update.processor.DistributedUpdateProcessor.versionAdd(DistributedUpdateProcessor.java:717)
at org.apache.solr.update.processor.DistributedUpdateProcessor.processAdd(DistributedUpdateProcessor.java:557)
at org.apache.solr.update.processor.LogUpdateProcessor.processAdd(LogUpdateProcessorFactory.java:100)
at org.apache.solr.handler.dataimport.SolrWriter.upload(SolrWriter.java:70)
at org.apache.solr.handler.dataimport.DataImportHandler$1.upload(DataImportHandler.java:235)
at org.apache.solr.handler.dataimport.DocBuilder.buildDocument(DocBuilder.java:512)
at org.apache.solr.handler.dataimport.DocBuilder.buildDocument(DocBuilder.java:416)
at org.apache.solr.handler.dataimport.DocBuilder.doFullDump(DocBuilder.java:331)
at org.apache.solr.handler.dataimport.DocBuilder.execute(DocBuilder.java:239)
at org.apache.solr.handler.dataimport.DataImporter.doFullImport(DataImporter.java:411)
at org.apache.solr.handler.dataimport.DataImporter.runCmd(DataImporter.java:483)
at org.apache.solr.handler.dataimport.DataImporter$1.run(DataImporter.java:464)
In the schema.xml
file you have mentioned id as required field = true
.
Also the document that you are trying to index in SOLR do not contain this id field and hence SOLR is throwing this error.
OR
required = true
form schema file for id field.Please share your schema.xml
file and the documents that you are trying to index into SOLR.
Also keep in mind if you want quick response try to provide as much details as you can.
this is probably where the error reporting should be improved for solr
for my case, I've defined a string field
not related with KEY
, and I am trying to put a null
value to that field. I should probably indicate the field is nullable
.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With