On Thu, Oct 22, 2009 at 7:01 PM, Joe Calderon <calderon....@gmail.com> wrote:
> hello *, i was just reading over the wiki function query page and
> found this little gem for boosting recent docs thats much better than
> what i was doing before
>
> recip(ms(NOW,mydatefield),3.16e-11,1,1)

Thanks, it's pretty new (like 2 or 3 days).  Still kind of arbitrary
(1 year old = 1/2 the relevance) but it seemed like a decent starting
point.

> my question is, at the bottom it says
> The most effective way to use such a boost is to multiply it with the
> relevancy score, rather than add it in. One way to do this is with the
> boost query parser.
>
> how exactly do i use the boost query parser along with the dismax
> parser? can someone post an example solrconfig snippet?

See the boost link if you haven't already:
http://lucene.apache.org/solr/api/org/apache/solr/search/BoostQParserPlugin.html

The value of the boost ("foo" in that example) is a full sub-query...
meaning you can change it's type
and specify it as {!dismax qf=text pf=text}foo

Or, you could set the defaultType for the subquery to dismax in the
boost itself  (and specify the other dismax params globally):

{!boost b=... defType=dismax v=$qq}
&qq=ipod
&qf=text
&pf=text
...

See also the basic rules of LocalParams if you haven't already:
http://wiki.apache.org/solr/LocalParams

And the relevancy faq:
http://wiki.apache.org/solr/SolrRelevancyFAQ#How_can_I_boost_the_score_of_newer_documents

And here's a full URL for you to chew on:
http://localhost:8983/solr/select?q={!boost b=$dateboost v=$qq
defType=dismax}&dateboost=recip(ms(NOW,manufacturedate_dt),3.16e-11,1,1)&qf=text&pf=text&qq=ipod+touch&debugQuery=true


-Yonik
http://www.lucidimagination.com

Reply via email to