Solr:QueryElevationComponent要求StrField uniqueKeyField错误 [英] Solr: QueryElevationComponent requires StrField uniqueKeyField error

查看:125
本文介绍了Solr:QueryElevationComponent要求StrField uniqueKeyField错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我最近安装了solr.示例索引(位于apache-solr-#.#.#\ example \ solr上)似乎有效,并且一旦复制到我的solr主目录中,便可以通过管理页面访问它.但是,当我尝试通过将schema.xml内容替换为(取自

I recently installed solr. The example index (found at apache-solr-#.#.#\example\solr) seems to work, and, once copied to my solr home directory, I am able to access it through the admin pages. However when I try to implement a new index by replacing the schema.xml content with (taken from here):

<?xml version="1.0" encoding="UTF-8" ?> 
  <schema name="example" version="1.2">
  <types>
      <fieldType name="string" class="solr.StrField" sortMissingLast="true" omitNorms="true" /> 
      <fieldType name="int" class="solr.TrieIntField" precisionStep="0" omitNorms="true" positionIncrementGap="0" /> 
      <fieldType name="date" class="solr.TrieDateField" omitNorms="true" precisionStep="0" positionIncrementGap="0" /> 
      <fieldType name="text" class="solr.TextField" positionIncrementGap="100">
          <analyzer type="index">
              <tokenizer class="solr.WhitespaceTokenizerFactory" /> 
              <filter class="solr.StopFilterFactory" ignoreCase="true" words="stopwords.txt" enablePositionIncrements="true" /> 
              <filter class="solr.WordDelimiterFilterFactory" generateWordParts="1" generateNumberParts="1" catenateWords="1" catenateNumbers="1" catenateAll="0" splitOnCaseChange="1" /> 
              <filter class="solr.LowerCaseFilterFactory" /> 
              <filter class="solr.SnowballPorterFilterFactory" language="English" protected="protwords.txt" /> 
          </analyzer>
        <analyzer type="query">
          <tokenizer class="solr.WhitespaceTokenizerFactory" /> 
          <filter class="solr.SynonymFilterFactory" synonyms="synonyms.txt" ignoreCase="true" expand="true" /> 
          <filter class="solr.StopFilterFactory" ignoreCase="true" words="stopwords.txt" enablePositionIncrements="true" /> 
          <filter class="solr.WordDelimiterFilterFactory" generateWordParts="1" generateNumberParts="1" catenateWords="0" catenateNumbers="0" catenateAll="0" splitOnCaseChange="1" /> 
          <filter class="solr.LowerCaseFilterFactory" /> 
          <filter class="solr.SnowballPorterFilterFactory" language="English" protected="protwords.txt" /> 
        </analyzer>
      </fieldType>
      </types>
  <fields>
      <field name="fileid" type="int" indexed="true" stored="true" required="true" /> 
      <field name="doctext" type="text" indexed="true" stored="false" required="false" /> 
      <field name="title" type="text" indexed="true" stored="false" required="false" /> 
      <field name="datecreated" type="date" indexed="true" stored="false" /> 
  </fields>
  <uniqueKey>fileid</uniqueKey> 
  <defaultSearchField>doctext</defaultSearchField> 
  <solrQueryParser defaultOperator="OR" /> 
  </schema>

我收到一个配置错误,这似乎表明uniqueKeyField必须使用StrField类型实现(我很难相信确实是这种情况?):

I am receiving a configuration error, which seems to suggest that the uniqueKeyField must be implemented with a StrField type (something I find hard to believe is actually the case?)):

"HTTP状态500-solr配置中存在严重错误.... org.apache.solr.common.SolrException:QueryElevationComponent要求该架构具有使用StrField在org.apache.solr.handler上实现的uniqueKeyField. org.apache.solr.core.SolrResourceLoader.inform(SolrResourceLoader.java:508)处的component.QueryElevationComponent.inform(QueryElevationComponent.java:157)..."

我的谷歌搜索几乎没有什么帮助,所以我希望周围可能有人遇到这个问题和/或对解决这个问题有一些想法?

My googling has turned up very little to help, so I am hoping there might be someone around here who might have come across this issue and/or have some ideas how to resolve it?

Bea,谢谢您的任何建议.

Thanks in advance for any advice, Bea.

推荐答案

是的,目前QueryElevationComponent需要一个字符串唯一键.此限制是Solr Wiki中记录的 .

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

这是项目JIRA中的问题.

这篇关于Solr:QueryElevationComponent要求StrField uniqueKeyField错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆