• 博客园logo
  • 会员
  • 众包
  • 新闻
  • 博问
  • 闪存
  • 赞助商
  • HarmonyOS
  • Chat2DB
    • 搜索
      所有博客
    • 搜索
      当前博客
  • 写随笔 我的博客 短消息 简洁模式
    用户头像
    我的博客 我的园子 账号设置 会员中心 简洁模式 ... 退出登录
    注册 登录
Elephant
程序猿
博客园    首页    新随笔    联系   管理    订阅  订阅
solr异常解决

使用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>

 

posted on 2014-11-11 17:43  fanelephant  阅读(598)  评论(0)    收藏  举报
刷新页面返回顶部
博客园  ©  2004-2025
浙公网安备 33010602011771号 浙ICP备2021040463号-3