lucene-solr-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Apache Wiki <wikidi...@apache.org>
Subject [Solr Wiki] Update of "SolrRelevancyFAQ" by YonikSeeley
Date Sun, 18 Oct 2009 22:30:12 GMT
Dear Wiki user,

You have subscribed to a wiki page or wiki category on "Solr Wiki" for change notification.

The "SolrRelevancyFAQ" page has been changed by YonikSeeley.
The comment on this change is: add full examples of date boosting.
http://wiki.apache.org/solr/SolrRelevancyFAQ?action=diff&rev1=13&rev2=14

--------------------------------------------------

    * Do an explicit sort by date (relevancy scores are ignored)
    * Use an index-time boost that is larger for newer documents
    * Use a FunctionQuery to influence the score based on a date field.
-     Use something of the form recip(rord(myfield),1,1000,1000)
+     * In Solr 1.3, use something of the form recip(rord(myfield),1,1000,1000)
+     * In Solr 1.4, use something of the form recip(ms(NOW,mydatefield),3.16e-11,1,1)
-     http://lucene.apache.org/solr/api/org/apache/solr/search/function/ReciprocalFloatFunction.html
+   http://lucene.apache.org/solr/api/org/apache/solr/search/function/ReciprocalFloatFunction.html
+ 
+   http://lucene.apache.org/solr/api/org/apache/solr/search/BoostQParserPlugin.html
+ 
+ A full example of a query for "ipod" with the score boosted higher the newer the product
is:
+ {{{
+ http://localhost:8983/solr/select?q={!boost b=recip(ms(NOW,manufacturedate_dt),3.16e-11,1,1)}ipod
+ }}}
+ 
+ One can simplify the implementation by decomposing the query into multiple arguments:
+ {{{
+ http://localhost:8983/solr/select?q={!boost b=$dateboost v=$qq}&dateboost=recip(ms(NOW,manufacturedate_dt),3.16e-11,1,1)&qq=ipod
+ }}}
+ 
+ Now the main "q" argument as well as the "dateboost" argument may be specified as defaults
in a search handler in solrconfig.xml, and clients would only need to pass "qq", the user
query.
+ 
  
  == How do I give a very low boost to documents that match my query ==
  In general the problem is that a "low" boost is still a boost, it can only improve the score
of documents that match. One way to fake a "negative boost" is to give a high boost to everything
that does *not* match. For example:

Mime
View raw message