Solr 4.0 如何更改拼写检查器分析器,使它们完全相同? [英] Solr 4.0 How can I change the spellchecker analysers so they are all the same?

查看:26
本文介绍了Solr 4.0 如何更改拼写检查器分析器,使它们完全相同?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我刚刚从 3.6.1 升级到 4.0 solr,拼写检查器停止工作.我正在使用标准配置/拼写请求处理程序来测试拼写检查.

I've just upgraded from 3.6.1 to 4.0 solr and the spelchecker stopped working. I'm using the standard config /spell request handler to test the spellchecking.

我不断收到所有检查器都需要使用相同的分析器"错误.(https://svn.apache.org/repos/asf/lucene/dev/trunk/solr/core/src/java/org/apache/solr/spelling/ConjunctionSolrSpellChecker.java)

I keep getting the "All checkers need to use the same Analyzer" error. (https://svn.apache.org/repos/asf/lucene/dev/trunk/solr/core/src/java/org/apache/solr/spelling/ConjunctionSolrSpellChecker.java)

如何更改拼写检查器分析器以使其完全相同?

How can I change the spellchecker analysers so they are all the same?

这是我正在使用的处理程序:

This is the handler I'm using:

  <requestHandler name="/spell" class="solr.SearchHandler" startup="lazy">
    <lst name="defaults">
      <str name="df">text</str>
      <!-- Solr will use suggestions from both the 'default' spellchecker
           and from the 'wordbreak' spellchecker and combine them.
           collations (re-written queries) can include a combination of
           corrections from both spellcheckers -->
      <str name="spellcheck.dictionary">default</str>
      <str name="spellcheck.dictionary">wordbreak</str>
      <str name="spellcheck">on</str>
      <str name="spellcheck.extendedResults">true</str>       
      <str name="spellcheck.count">10</str>
      <str name="spellcheck.alternativeTermCount">5</str>
      <str name="spellcheck.maxResultsForSuggest">5</str>       
      <str name="spellcheck.collate">true</str>
      <str name="spellcheck.collateExtendedResults">true</str>  
      <str name="spellcheck.maxCollationTries">10</str>
      <str name="spellcheck.maxCollations">5</str>         
    </lst>
    <arr name="last-components">
      <str>spellcheck</str>
    </arr>
</requestHandler>

我知道这不是在生产中使用它的方式.

I know that this is not the way to use it in production.

推荐答案

答案在于 solrconfig.xml 中拼写检查searchComponent"的配置.在那里,每个拼写检查器条目的字段"和/或字段类型"属性应具有相同的值.

The answer lies in the configuration of the spell check "searchComponent" in solrconfig.xml. There, each spellchecker entry should have the same value for the "field" and/or "fieldType" attributes.

这篇关于Solr 4.0 如何更改拼写检查器分析器,使它们完全相同?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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