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 "FunctionQuery" by MarkusJelsma
Date Thu, 10 Mar 2011 15:41:01 GMT
Dear Wiki user,

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

The "FunctionQuery" page has been changed by MarkusJelsma.
http://wiki.apache.org/solr/FunctionQuery?action=diff&rev1=73&rev2=74

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

  Boosting more recent content is a common use case.  One way is to use a {{{recip}}} function
in conjunction with {{{ms}}}.
  
  There are approximately 3.16e10 milliseconds in a year, so one can scale dates to fractions
of a year with the inverse, or 3.16e-11. Thus the function '''recip(ms(NOW,mydatefield),3.16e-11,1,1)'''
will yield values near 1 for very recent documents, 1/2 for documents a year old, 1/3 for
documents two years old, etc. Be careful to not use this function for dates more than one
year in the future or the values will be negative.
+ 
+ Consider using reduced precision to prevent excessive memory consumption. You would instead
use '''recip(ms(NOW/HOUR,mydatefield),3.16e-11,1,1)'''.
+ See [[http://search-lucene.com/m/nkgRTTSRos1/FunctionQueries+and+FieldCache+and+OOM&subj=FunctionQueries+and+FieldCache+and+OOM|this
thread]] for more information.
  
  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 [[http://lucene.apache.org/solr/api/org/apache/solr/search/BoostQParserPlugin.html|boost]]
query parser.
  

Mime
View raw message