Solr date boost and sort by relevant results NOT working properly

一曲冷凌霜 提交于 2019-12-08 04:32:10

问题


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


回答1:


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:

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

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.



来源:https://stackoverflow.com/questions/6899258/solr-date-boost-and-sort-by-relevant-results-not-working-properly

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!