gpt4 book ai didi

java - Solr 4.0 如何更改拼写检查分析器,使它们都相同?

转载 作者:行者123 更新时间:2023-12-03 23:13:37 26 4
gpt4 key购买 nike

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

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

我如何更改拼写检查分析器,使它们完全相同?

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

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

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

最佳答案

答案就在solrconfig.xml中拼写检查“searchComponent”的配置中。在那里,每个拼写检查器条目的“field”和/或“fieldType”属性应该具有相同的值。

关于java - Solr 4.0 如何更改拼写检查分析器,使它们都相同?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13761215/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com