基于 Solr 拼写检查结果的过滤器查询
我根据 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.collate=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 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我之前从 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 theDirectoSolrSpellChecker
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.