Solr日期提升和按相关结果排序不正确 [英] Solr date boost and sort by relevant results NOT working properly

查看:333
本文介绍了Solr日期提升和按相关结果排序不正确的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在实现Solr dismax搜索,并且还使用此功能recip(ms(NOW,PubDate),3.16e-11,1000,1000)进行日期增强.一切正常,但只有一个问题.

I am implementing Solr dismax search and also using this function recip(ms(NOW,PubDate),3.16e-11,1000,1000) for date boost. Everthing is working fine but only got one problem.

如果标题"中重复了搜索关键字,则它们的得分要高于最近的搜索结果.

if search keywords are repeated in the Title, they get more score than recent results.

例如 1)标题= solr lucene

e.g. 1) Title = solr lucene

日期= 1天大

2)标题= solr lucene最好,喜欢solr lucene

2) Title = solr lucene is best, love solr lucene

日期= 15天

如果用户搜索"solr lucene",则#2只会排在第一位,因为标题中重复了关键字.

If user searched for 'solr lucene', then #2 comes at first position only because keywords are repeated in the Title.

我有太多记录,这些记录存在1,2或3天,它们甚至具有完全相同的标题"SOLR LUCENE",但这些记录并没有出现在首页上,这仅是因为旧记录的标题中重复了关键字.

I have got too many records which are1,2 or 3 days old and they have even the exact same title "SOLR LUCENE" but those records doesn't come on first page only because old records have keywords repeated in the Title.

我不想完全按日期对结果进行排序.目前,我正在像这样进行排序. sort =分数降序,日期升序

I don't want to sort the results entirely by date. Currently i am sorting it like this. sort= score desc, date asc

推荐答案

如果使用boost,则不应使用order子句. 如果您想给日期更多相关性,请拉皮条功能.由您决定,日期对搜索结果顺序的影响最大.

You shouldn't use an order clause, if you are using boost. If you like to give the date more relevance, so pimp your boost function. It's up to you, who big is the date influence for the order of the search result is.

这还取决于您使用的dismax处理程序:

It also depends on the dismax-handler you are using:

{!edismax boost=recip(pow(ms(NOW,PubDate),<val>),3.16e-11,1,1)}

在0和2之间放置一个值,而不是<val>占位符,其中0几乎是按日期排序",而2是按相关性排序.

Put an value instead of the <val> placeholder between 0 and 2, where 0 is nearly "order by date" and 2 is order by relevance.

不确定,这是否适用于dismax,但适用于标准solr搜索处理程序(使用上述示例以外的其他语法)和edismax.

Not sure, if this works for dismax, but it works for standard solr search handler (with other syntax than the example above) and edismax.

这篇关于Solr日期提升和按相关结果排序不正确的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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