Specifically if I'm doing a query using the solr mlt handler (http://wiki.apache.org/solr/MoreLikeThisHandler) and stream.body to supply the source doc is there any way to boost result documents based on document age?
I already know how to do that for a regular query using dismax (http://wiki.apache.org/solr/FunctionQuery#Date_Boosting) but I can't quite figure out the magic incantation to do it for the mlt handler.
It looks like the mlt handler is written to handle one of two cases:
q=[typical query goodness which can include date boosting]
stream.body=[url]
If q
is present, stream.body
is ignored and vice-versa, so unfortunately I don't think you'll be able to do what you want in a single call without patching the MoreLikeThisHandler.
BUT: If you need this in a hurry, you can do it with two queries
- Run your same MLT query solely for the purpose of retrieving the interesting-terms and boosts (e.g with
mlt.interestingTerms=details&mlt.boost=true&rows=0
)
- Using the interesting-terms and boosts from (1), run a standard Solr query (non-MLT) with the date-boosting function you desire.