【发布时间】:2018-05-22 17:22:05
【问题描述】:
我正在使用 Solr7.1(SolrCloud 模式),我不需要强制执行文档唯一性。
因此,我将架构中的 id 字段(指定为唯一键)标记为 required="false"。
<field name="id" type="string" indexed="true" stored="false" required="false" multiValued="false" />
<uniqueKey>id</uniqueKey>
我正在尝试使用 solr Admin UI 对一些文档进行索引,但我正在尝试不指定 'id' 字段。
{
"cat": "books",
"name": "JayStore"
}
我期待它能够成功建立索引,但 solr 抛出错误,提示“缺少强制唯一键字段 id”
谁能指导我做错了什么。
【问题讨论】:
-
请发布完整的错误日志,因为这可能会提供有关正在发生的事情的确切信息
-
@suvartheec 这是来自“更新” REST API ` { “responseHeader”:{ “status”:400, “QTime”:2}, “error”:{ “metadata”:[ "error-class","org.apache.solr.common.SolrException", "root-error-class","org.apache.solr.common.SolrException"], "msg":"文档缺少必填的 uniqueKey 字段: id", "code":400}} ` 这是管理 UI 上显示的消息:
Document is missing mandatory uniqueKey field: id
标签: indexing solr schema unique-key