【发布时间】:2013-09-09 12:51:00
【问题描述】:
我正在尝试将 Solr 4 配置为使用 UUID,但到目前为止我没有成功
通过阅读文档,我看到了两种不同的方式来配置 schema.xml 以使用 UUID(两者都不起作用)
两个我都需要写
<fieldType name="uuid" class="solr.UUIDField" indexed="true" />
选项 1: 添加:
<field name="id" type="uuid" indexed="true" stored="true" default="NEW" multiValued="false"/>
并确保删除该行
<uniqueKey>id</uniqueKey>
选项 2 添加:
<field name="id" type="uuid" indexed="true" stored="true" required="true" multiValued="false" />
两个选项都无法正常工作并返回 org.apache.solr.common.SolrException:org.apache.solr.common.SolrException: 初始化 QueryElevationComponent 时出错。
我还尝试使用配置在 colrconfig.xml 文件中添加一行:
<updateRequestProcessorChain name="uuid">
<processor class="solr.UUIDUpdateProcessorFactory">
<str name="fieldName">uniqueKey</str>
</processor>
<processor class="solr.RunUpdateProcessorFactory" />
</updateRequestProcessorChain>
谢谢,
西蒙
【问题讨论】:
-
您的基本设置是否可以在不尝试更改 id 字段类型的情况下工作? QueryElevationComponent 错误听起来可能是一般配置问题
-
是的,当将 id 设置为字符串时一切正常