Solr 4.0如何更改拼写检查分析器以使它们完全相同? [英] Solr 4.0 How can I change the spellchecker analysers so they are all the same?
问题描述
我刚刚从3.6.1升级到4.0 solr并且spelchecker停止了工作。我正在使用标准的配置/拼写请求处理程序来测试拼写检查。
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。在那里,每个拼写检查器条目应该具有field和/或fieldType属性的相同值。
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屋!