Solr 日期提升和按相关结果排序无法正常工作
我正在实现 Solr dismax 搜索,并使用此函数 recip(ms(NOW,PubDate),3.16e-11,1000,1000)
进行日期提升。一切正常,但只有一个问题。
如果搜索关键字在标题中重复,它们会比最近的结果获得更高的分数。
例如 1) 标题 = solr lucene
日期 = 1 天
2) 标题 = solr lucene 最好,喜欢 solr lucene
日期 = 15 天
如果用户搜索“solr lucene”,则 #2 出现在第一个位置,只是因为关键字在标题。
我有太多 1、2 或 3 天前的记录,它们甚至具有完全相同的标题“SOLR LUCENE”,但这些记录不会出现在首页上,只是因为旧记录的标题中重复了关键字。
我不想完全按日期对结果进行排序。目前我正在这样排序。排序=分数降序,日期升序
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.
e.g.
1) Title = solr lucene
Date = 1 day old
2) Title = solr lucene is best, love solr lucene
Date = 15 days old
If user searched for 'solr lucene', then #2 comes at first position only because keywords are repeated in the Title.
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.
I don't want to sort the results entirely by date. Currently i am sorting it like this. sort= score desc, date asc
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
如果您使用 boost,则不应使用 order 子句。
如果您想让日期更具相关性,请改进您的 boost 函数。日期对搜索结果的顺序影响有多大,就看你了。
它还取决于您使用的 dismax-handler:
在 0 和 2 之间放置一个值而不是
占位符,其中 0 几乎是“按日期排序”,2 是按相关性排序。不确定这是否适用于 dismax,但它适用于标准 solr 搜索处理程序(使用除上面示例之外的其他语法)和 edismax。
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.
It also depends on the dismax-handler you are using:
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.Not sure, if this works for dismax, but it works for standard solr search handler (with other syntax than the example above) and edismax.