Solr停用词出现在构面搜索结果中 [英] Solr stopwords showing up in facet search results

查看:157
本文介绍了Solr停用词出现在构面搜索结果中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我目前正在Solr架构中的文本字段上测试方面搜索,并注意到我在stopwords.txt文件中获得了大量结果.

I am currently testing facet searches on a text field in my Solr schema and noticing that I am getting a significant number of results that are in my stopwords.txt file.

我的模式当前正在使用文本数据类型的默认配置,给我的印象是,如果使用了"solr.StopFilterFactory"过滤器,则不会索引停用词.

My schema is currently using the default configuration for the text data type, and I was under the impression that stopwords were not indexed if the "solr.StopFilterFactory" filter was in use.

我希望有人可以对此有所启发,或者a)帮助我理解为什么停用词不适用于方面以及如何使用停用词,或者b)为我指明正确的方向,这样我的方面查询就可以了不会从停用词中返回单词.

I am hoping that someone can shed some light on this and either a) help me understand why stopwords don't apply to facets and how to live with it, or b) point me in the right direction so my facet queries don't return words from stopwords.

谢谢!

推荐答案

停止字确实适用于构面.换句话说:如果您要查询已用停用词索引的字段的构面,则在构面中不应看到任何停用词.

Stopwords do apply to facets. In other words: if you ask for a facet of a field that has been indexed with stopwords you should not see any stopwords in the facet.

我的猜测是,您没有按照自己的想法编制索引:您的schema.xml错误或您在与您认为不同的字段中编制了索引.

My guess is that you are not indexing the way you think: either your schema.xml is wrong or you are indexing in a different field than you think.

我在此领域使用了方面,效果很好:

I am using facets on this field and works well:

<fieldType name="text_ws_stop" class="solr.TextField" positionIncrementGap="100">
  <analyzer>
<tokenizer class="solr.WhitespaceTokenizerFactory"/>
            <filter class="solr.StopFilterFactory"
    ignoreCase="true"
            words="stopwords_spanish.txt"
            enablePositionIncrements="true"
    />
  </analyzer>
</fieldType>

...

<field name="phrases" type="text_ws_stop" indexed="true" stored="true" required="false"/>

这篇关于Solr停用词出现在构面搜索结果中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆