Solr 拼写检查多词
Solr spell check mutliwords
无法找出我配置的 Solr 拼写检查器未提供所需输出的真正原因。在我的索引数据查询中:symphony+mobile 有大约 3.5K+ 文档,拼写检查器检测到它拼写正确。当我在查询中拼错 "symphony" 时:symphony+mobile 它只显示 "mobile" 的结果,拼写检查器检测到此查询拼写正确。我以不同的组合搜索了这个查询。请找到搜索结果统计
查询:交响曲
**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>
已解决 :) 找到了我的问题的真正原因。我将 "maxResultsForSuggest" 设置为 5,这就是它不显示建议的原因,因为查询中的每个词的搜索结果都多于 5
无法找出我配置的 Solr 拼写检查器未提供所需输出的真正原因。在我的索引数据查询中:symphony+mobile 有大约 3.5K+ 文档,拼写检查器检测到它拼写正确。当我在查询中拼错 "symphony" 时:symphony+mobile 它只显示 "mobile" 的结果,拼写检查器检测到此查询拼写正确。我以不同的组合搜索了这个查询。请找到搜索结果统计
查询:交响曲
**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>
已解决 :) 找到了我的问题的真正原因。我将 "maxResultsForSuggest" 设置为 5,这就是它不显示建议的原因,因为查询中的每个词的搜索结果都多于 5