You add a range query on the date, and boost documents within that date range. Check out the 'boost query' feature of dismax.
http://www.lucidimagination.com/search/document/CDRG_ch07_7.4.2.9 It's also possible with the standard query parser but a pain in the neck: (value)^2 OR (NOT value) On Thu, Jan 28, 2010 at 6:58 PM, Andy <angelf...@yahoo.com> wrote: > My documents have a field "expiration" that is the expiration date of that > doc. > > I want to give a boost to all documents that haven't expired. I still want to > have expired documents returned, but unexpired documents should be given > priority. > > Ideally the boost amount for all unexpired documents should be the same. i.e. > whether the expiration date is tomorrow or a month from now wouldn't make a > difference. Like wise all expired documents should be treated the same, > whether it expired yesterday or a year ago. > > Is that something possible? I read > http://wiki.apache.org/solr/SolrRelevancyFAQ#How_can_I_boost_the_score_of_newer_documents > but that's not quite what I want. > > > > -- Lance Norskog goks...@gmail.com