I have a Solr index and each document is the information of an Event. In my schema Schedule is a multivalued field of type date. I am wondering if it is possible to boost the documents with a schedule date (any of those dates in the multivalued field) in the future and closest to the current date? I am using Dismax query and SolrNet client api.
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试):
问题:
回答1:
You can user Solr FunctionQuery - recip
.
Example function query:
recip(ms(NOW/HOUR,_datefield_),3.16e-11,1,1)
Also read relevancy FAQ: http://wiki.apache.org/solr/SolrRelevancyFAQ#How_can_I_boost_the_score_of_newer_documents