I think you can combine serveral solr supplied standard function query to
achieve this.

similar to:
&bf=map(map(div(ms(NOW, expiration),86400000),-10000,0,0), 1,10000,1)

Furthermore, you would implement your own function and register it in
solrconfig.xml using valueSourceParser tag.

2010/1/29 Andy <angelf...@yahoo.com>

> Ah, thank you!
>
>
>
> --- On Fri, 1/29/10, Lance Norskog <goks...@gmail.com> wrote:
>
> > From: Lance Norskog <goks...@gmail.com>
> > Subject: Re: boosting unexpired documents
> > To: solr-user@lucene.apache.org
> > Date: Friday, January 29, 2010, 12:32 AM
> > 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
> >
>
>
>
>


-- 
梅旺生

Reply via email to