1

Solr is reporting that it is missing a required field (documentId) but the field and value are being passed to Solr. From the schema:

<fields>
   <field name="id" type="string" indexed="true" stored="true" required="true" /> 
   <field name="documentId" type="string" indexed="true" stored="true" required="true" /> 
</fields>

According to the Solr log, the documentId is being passed in:

org.apache.solr.core.SolrCore execute
INFO: [] webapp=/solr path=/update/extract params={waitSearcher=true&commit=true
&literal.id=C:\documents\102\Comps+Database+BRD.docx&literal.documentId=102&w
t=javabin&waitFlush=true&version=2} status=400 QTime=489

Why would Solr then report:

org.apache.solr.common.SolrException log
SEVERE: org.apache.solr.common.SolrException: [doc=C:\documents\102\test.docx]
 missing required field: documentId

Edit Corrected typo in extract request, but still same error.

James
  • 2,876
  • 18
  • 72
  • 116
  • I wonder if the error has something to do with "version=2" in the request. This should be version 1 of the document. – James Oct 10 '12 at 14:54

3 Answers3

5

For some reason, Solr doesn't like the "Id" suffix on field names. When I rename "documentId" to "document", I get no errors. It also failed on "testId", but worked when I renamed to "test". Does anyone know why "Id" field name suffix would cause solr to always report missing required field even when passed a value?

James
  • 2,876
  • 18
  • 72
  • 116
1

it looks like there is an typo dcoumentId= while the filed definition uses documentId

you see the difference? dco... and doc....

The Bndr
  • 13,204
  • 16
  • 68
  • 107
0

your field name should be in small case letter like "documentid". solr does not save data in field if the field name contain capital letter even single one. incase of solr we don't have to follow camel case convention. so lesson is if you want to create a field and store data in it you need to make it small case field. example "documentid" or "testid" NOT "documentId" or "Documentid" etc