boosting unexpired documents

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

boosting unexpired documents

Andy-152
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.


     
Reply | Threaded
Open this post in threaded view
|

Re: boosting unexpired documents

Lance Norskog-2
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 <[hidden email]> 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
[hidden email]
Reply | Threaded
Open this post in threaded view
|

Re: boosting unexpired documents

Andy-152
Ah, thank you!



--- On Fri, 1/29/10, Lance Norskog <[hidden email]> wrote:

> From: Lance Norskog <[hidden email]>
> Subject: Re: boosting unexpired documents
> To: [hidden email]
> 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 <[hidden email]>
> 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
> [hidden email]
>



Reply | Threaded
Open this post in threaded view
|

Re: boosting unexpired documents

Wangsheng Mei
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 <[hidden email]>

> Ah, thank you!
>
>
>
> --- On Fri, 1/29/10, Lance Norskog <[hidden email]> wrote:
>
> > From: Lance Norskog <[hidden email]>
> > Subject: Re: boosting unexpired documents
> > To: [hidden email]
> > 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 <[hidden email]>
> > 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
> > [hidden email]
> >
>
>
>
>


--
梅旺生