无法弄清楚为什么我配置的Solr拼写检查器没有给出欲望输出的实际原因。在我的索引数据查询中:symphony + mobile有大约3.5K +文档,拼写检查器将其检测为正确拼写。当我想念拼写"交响曲"在查询中:symphony + mobile它只显示" mobile"和拼写检查器检测此查询是否拼写正确。我用不同的组合搜索了这个查询。请找到搜索结果stat
查询:symphony
**ResultFound**: 1190
**SpellChecker**: correctly spelled
查询:移动
**ResultFound**: 2850
**SpellChecker**: correctly spelled
查询:simphony
**ResultFound**: 0
**SpellChecker**: symphony
**Collation Hits**: 1190
查询:symphony + mobile
**ResultFound**: 3585
**SpellChecker**: correctly spelled
查询:simphony + mobile
**ResultFound**: 2850
**SpellChecker**: correctly spelled
查询:symphony + mbile
**ResultFound**: 1190
**SpellChecker**: correctly spelled
在最后两个查询中,它应该为拼写错误的单词" simphony"和" mbile"
请在下面找到我的配置。仅显示拼写检查配置。
solrconfig.xml
:
<requestHandler name="/select" class="solr.SearchHandler">
<lst name="defaults">
<str name="echoParams">explicit</str>
<int name="rows">10</int>
<str name="df">product_name</str>
<str name="spellcheck">on</str>
<str name="spellcheck.dictionary">default</str>
<str name="spellcheck.dictionary">wordbreak</str>
<str name="spellcheck.extendedResults">true</str>
<str name="spellcheck.count">5</str>
<str name="spellcheck.alternativeTermCount">2</str>
<str name="spellcheck.maxResultsForSuggest">5</str>
<str name="spellcheck.collate">true</str>
<str name="spellcheck.collateExtendedResults">true</str>
<str name="spellcheck.maxCollationTries">5</str>
<str name="spellcheck.maxCollations">3</str>
</lst>
<arr name="last-components">
<str>spellcheck</str>
</arr>
</requestHandler>
<searchComponent name="spellcheck" class="solr.SpellCheckComponent">
<str name="queryAnalyzerFieldType">text_suggest</str>
<lst name="spellchecker">
<str name="name">default</str>
<str name="field">suggest</str>
<str name="classname">solr.DirectSolrSpellChecker</str>
<str name="distanceMeasure">internal</str>
<float name="accuracy">0.5</float>
</lst>
<lst name="spellchecker">
<str name="name">wordbreak</str>
<str name="field">suggest</str>
<str name="classname">solr.WordBreakSolrSpellChecker</str>
<str name="combineWords">true</str>
<str name="breakWords">true</str>
<int name="maxChanges">10</int>
<int name="minBreakLength">5</int>
</lst>
</searchComponent>
schema.xml
:
<fieldType name="text_suggest" class="solr.TextField" positionIncrementGap="100">
<analyzer>
<tokenizer class="solr.UAX29URLEmailTokenizerFactory"/>
<filter class="solr.StopFilterFactory" ignoreCase="true"
words="stopwords.txt"/>
<filter class="solr.LowerCaseFilterFactory"/>
<filter class="solr.ASCIIFoldingFilterFactory"/>
<filter class="solr.EnglishPossessiveFilterFactory"/>
</analyzer>
</fieldType>
答案 0 :(得分:0)
已解决:)找到我的问题的实际原因。我设置了&#34; maxResultsForSuggest&#34;这就是为什么它没有显示建议,因为查询中的每个单词都有更多的搜索结果然后5