Solr: QueryElevationComponent requires StrField uniqueKeyField error

自作多情 提交于 2019-11-28 13:39:01

Yes, at the moment QueryElevationComponent requires a string unique key. This limitation is documented in the Solr wiki.

Here's the issue in the project JIRA.

AruKris

If you are still looking for an answer,

In schema.xml , include the following

<fieldType name="uuid" class="solr.UUIDField" indexed="true" /> 
<field name="id" type="uuid" indexed="true" stored="true" default="NEW" /> 

In elevate.xml, use this ID to map your search term to the best bet result .

<elevate>
 <query text="foo bar">
  <doc id="4602376f-9741-407b-896e-645ec3ead457" />
 </query>
</elevate>

Here, 4602376f-9741-407b-896e-645ec3ead457 is the value in the "id" field of the best bet document. Wish, Solr allows us to specify any primary key field , say employeeid or productid for specifying in the elevate.xml

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