使用solr1.4跟solr3.1时,配置了个唯一id类型是sint 或者int,启动时在tomcat后台就会抛出这个异常:
org.apache.solr.common.SolrException:
QueryElevationComponent requires the schema to have a uniqueKeyField implemented using StrField。
之前都是将sint或者int换为StrField类型解决问题的,后来发现只要去掉solrconfig.xml配置的 即 Elevation 组件就可以了:
1 <!-- Query Elevation Component 2 3 http://wiki.apache.org/solr/QueryElevationComponent 4 5 a search component that enables you to configure the top 6 results for a given query regardless of the normal lucene 7 scoring. 8 --> 9 <searchComponent name="elevator" class="solr.QueryElevationComponent" > 10 <!-- pick a fieldType to analyze queries --> 11 <str name="queryFieldType">string</str> 12 <str name="config-file">elevate.xml</str> 13 </searchComponent> 14 15 <!-- A request handler for demonstrating the elevator component --> 16 <requestHandler name="/elevate" class="solr.SearchHandler" startup="lazy"> 17 <lst name="defaults"> 18 <str name="echoParams">explicit</str> 19 <str name="df">text</str> 20 </lst> 21 <arr name="last-components"> 22 <str>elevator</str> 23 </arr> 24 </requestHandler>