gpt4 book ai didi

Solr – 将 SeachHandler 的 SeachComponent 配置为最小匹配 = 100%,并且仍然忽略搜索查询中的停用词

转载 作者:行者123 更新时间:2023-12-05 01:02:26 25 4
gpt4 key购买 nike

我们的索引分析器配置了 solr.StopFilterFactory。所以停用词没有编入索引。

我们还使用 solr.StopFilterFactory 配置了查询分析器,因为我们希望从搜索查询词中忽略停用词

<analyzer type="query">
<tokenizer class="solr.StandardTokenizerFactory"/>
<filter class="solr.StopFilterFactory"
ignoreCase="true"
words="lang/stopwords_en.txt"
enablePositionIncrements="true"
/>
... ...

在solrconfig.xml中,选择SearchHandler配置为使用SearchComponent参数最小匹配=100%

<requestHandler name="/select" class="solr.SearchHandler">
<lst name="defaults">
<str name="echoParams">explicit</str>
<int name="rows">10</int>
<str name="mm">100%</str>
<str name="q.alt">*:*</str>
... ...

这导致我们的一些多词搜索查询没有返回任何结果,例如“雨中仪式”。由于“in”和“the”上面的设置未编入索引,但最小匹配使它们成为强制性的,即使查询分析器配置为删除停用词也是如此。

是否有任何设置可以让我们实现这一点?

最佳答案

在这种情况下,您必须考虑查询中涉及的不同 fieldTypes,区分这两个类别:使用相同停止过滤器定义的 solr.TextField 类型,等领域。涉及的不同类型取决于通过 qf 参数请求的查询字段。

如果查询包含停用词并且 2 类字段在 qf 中混合,您将遇到问题,因为始终会有一个必需的子句试图匹配“不间断-”上的停用词filtered”字段(例如数字字段或没有停止过滤器的文本字段),除非您设置较低的 mm

mm.autoRelax edismax 解析器的参数旨在处理这种错误行为,自 Solr 6.0 ( SOLR-3085 ) 起可用:

If true, the number of clauses required (minimum should match) will automatically be relaxed if a clause is removed (by e.g. stopwords filter) from some but not all qf fields. Use this parameter as a workaround if you experience that queries return zero hits due to uneven stopword removal between the qf fields.

如果你不能使用mm.autoRelax,只要你需要mm=100%,你就必须设置qf只有文本字段使用相同 停止过滤器(相同的参数和字典)来保证当查询包含停用词时的一致行为。

关于Solr – 将 SeachHandler 的 SeachComponent 配置为最小匹配 = 100%,并且仍然忽略搜索查询中的停用词,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/40132076/

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