通过顶部指定的搜索词提升结果
我正在使用 apache solr 3.1 和 drupal
如何将搜索字段中指定的结果提升到顶部?
在搜索字段中的示例,如果用户输入继续,solr会显示顶部具有连续性的文档,下面显示继续的文档,我想显示连续高于连续性
http://localhost:8983/ solr/select/?q=继续&qf=标题&fl=标题%20score&bq=标题:继续^10.0
I'm using apache solr 3.1 with drupal
How can boost result on top which is specified in search field?
Example in search field, if user enters continuing, solr shows the document which have Continuity on top and the one with continuing below, i want to show the one with continuing above than the Continuity
http://localhost:8983/solr/select/?q=continuing&qf=title&fl=title%20score&bq=title:continuing^10.0
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
看来您在过滤器链中有词干分析器,因此连续性和连续性并映射到相同的根并且将被同等对待。
您想要检查您正在使用的词干分析器,并希望根据您的需要获得一个。默认的波特词干分析器非常激进,您可能需要一个不太激进的选项。
Solr 目前不会将精确匹配提升到比生成相同根的其他项更高的水平。
一种选择是在架构中包含两个字段。
词干 (title_stemmed) 和非词干版本(标题 - 没有词干过滤器)
示例 -
schema.xml -
您可以对字段进行加权 -
solrconfig.xml - 修改默认请求处理程序
,以便精确匹配比非精确匹配产生更多分数匹配并且显得更高。
网址 -
It seems you have stemmer in the filter chains, due to which continuing and Continuity and mapped to the same root and would be treated equal.
you want want to check for the stemmer you are using and want to get one depending upon your needs. The default porter stemmer is very agressive, and you may want an less agressive options.
Solr does not currently boost the exact match higher than the other terms which generated the same root.
One option would be to have two fields in your schema.
Stemmed (title_stemmed) and a Non Stemmed version (title - without the stemming filter)
example -
schema.xml -
you can weight the fields -
solrconfig.xml - modify the default request handler
so that the exact match produces more score than the non exact matches and appears higher.
URL -