Solr - 缺少必填字段

问题描述:

Solr报告缺少必填字段(documentId),但该字段和值正在传递给Solr。从架构:Solr - 缺少必填字段

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

根据Solr的日志中,documentId被传递:

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 

为什么会Solr的然后报告:

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

编辑 更正错字在提取请求中,但仍然是相同的错误。

+0

我想知道错误是否与请求中的“version = 2”有关。这应该是文档的第1版。 – James

由于某些原因,Solr不喜欢字段名称上的“Id”后缀。当我将“documentId”重命名为“document”时,我没有任何错误。它在“testId”上也失败了,但是当我改名为“test”时工作。有谁知道为什么“ID”字段名称后缀会导致solr始终报告缺少必填字段,即使传递一个值?

+0

...哇,这很奇怪 –

+0

这很有趣! – lizzie

它看起来像有一个错字dcoumentId=而提起定义使用documentId

你看有什么区别? dco ...和doc ....

+0

谢谢。我纠正了错字,仍然得到相同的错误。 – James