Solr boost for multivalued date field

2019-07-05 12:28发布

问题:

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



标签: solr solrnet