基于 Solr 拼写检查结果的过滤器查询

发布于 2024-12-28 21:53:03 字数 944 浏览 4 评论 0原文

我根据 http://wiki.apache.org/solr/SpellCheckComponent ,效果很好。但我正在尝试根据其他过滤器过滤拼写检查结果。考虑以下模式

product_name
product_text
product_category
product_spell -> copy string from product_name and product_text . And tokenized using white space analyzer

对于上述模式,我尝试根据提供的类别过滤拼写检查结果。我尝试查询 http://127.0.0.1:8080/solr/colr1/myspellcheck/?q=product_category:160%20appl&spellcheck=true&spellcheck.extendedResults=true&spellcheck.collat​​e=true拼写检查结果不考虑product_category:160

是否因为字典是为所有类别构建的?如果是这样,为每个类别创建字典是个好主意吗?

拼写检查组件中是否不可能有另一个过滤条件?

我使用的是solr 3.5

I implemented Solr SpellCheck Component based on the document from http://wiki.apache.org/solr/SpellCheckComponent , it works good. But i am trying to filter the spell check result based on some other filter. Consider the following schema

product_name
product_text
product_category
product_spell -> copy string from product_name and product_text . And tokenized using white space analyzer

For the above schema, i am trying to filter the spell check result based on provided category. I tried querying like http://127.0.0.1:8080/solr/colr1/myspellcheck/?q=product_category:160%20appl&spellcheck=true&spellcheck.extendedResults=true&spellcheck.collate=true . Spellcheck results does not consider the product_category:160

Is it because the dictionary was build for all the categories? If so is it a good idea to create the dictionary for every category?

Is it not possible to have another filter condition in spellcheck component?

I am using solr 3.5

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

淡忘如思 2025-01-04 21:53:03

我之前从 SOLR-2010 问题中了解到,通过 fq 进行过滤 参数应该可以使用排序规则,但事实并非如此,我想我误解了。

事实上,除了 DirectoSolrSpellChecker 实现之外,SpellCheckComponent 很可能有一个单独的索引。这意味着您选择的字段在不同的索引中建立索引,该索引仅包含有关您选择进行拼写更正的特定字段的信息。

如果您好奇,您还可以使用 luke 查看附加索引的外观,因为这当然是一个lucene索引。不幸的是,使用其他字段进行过滤并不是一种选择,因为那里只有一个字段,即用于进行拼写更正的字段。

I previously understood from the SOLR-2010 issue that filtering through the fq parameter should be possible using collation, but it isn't, I think I misunderstood.

In fact, the SpellCheckComponent has most likely a separate index, except for the DirectoSolrSpellChecker implementation. It means the field you select is indexed in a different index, which contains only the information about that specific field you chose to make spelling corrections.

If you're curious, you can also have a look how that additional index looks like using luke, since it's of course a lucene index. Unfortunately filtering using other fields isn't an option there, simply because there is only one field there, the one you use to make spelling corrections.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文