Solr - Missing Required Field

血红的双手。 提交于 2020-01-05 07:44:11

问题


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.


回答1:


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?




回答2:


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

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



来源:https://stackoverflow.com/questions/12821782/solr-missing-required-field

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!