Solr 4.0.0 define <uniqueKey> id</uniqueKey> as a “long” type throws an error on startup

三世轮回 提交于 2019-12-24 12:49:00

问题


In my entity clas, I defined id:

@Field("id")
protected Long id;

then in solr4.0.0 schema.xml, i define:

<field name="id" type="long" indexed="true" stored="true" />
<uniqueKey>id</uniqueKey>

then solr throws exception on startup. If 'id' is defined as 'string' type, no exception. so my question is: what's the solution if i insisted on defining 'id' as long type.


回答1:


Check SOLR-2997
It seems QueryElevationComponent needs the Unique key in String format. So if you don't need it you can remove it.




回答2:


Just remove the below node in solrconfig.xml file:

<searchComponent name="elevator" class="solr.QueryElevationComponent" >  
<!-- pick a fieldType to analyze queries -->  
<str name="queryFieldType">string</str>  
<str name="config-file">elevate.xml</str>  
</searchComponent> 


来源:https://stackoverflow.com/questions/14208477/solr-4-0-0-define-uniquekey-id-uniquekey-as-a-long-type-throws-an-error-on

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