Re: including time as a factor in relevance?

2006-07-15 Thread Brent Verner
[2006-07-15 14:06] WHIRLYCOTT said:
| I need to have my search result relevance influenced by time.  Older  
| things in my index are less relevant than newer things.  I don't want  
| to do a strict sort by date.  Is this supported somehow by using a  
| dismax request handler?  Or if you have other hints, I'm eager to  
| know what they are.

  I've recently used solr's FunctionQuery to do just this with great 
success.  Take a look at FunctionQuery and ReciprocalFloatFunction.
If I have some time later today, I'll put together a simple example.

cheers!
  Brent



Re: including time as a factor in relevance?

2006-07-15 Thread Yonik Seeley

On 7/15/06, WHIRLYCOTT [EMAIL PROTECTED] wrote:

I need to have my search result relevance influenced by time.  Older
things in my index are less relevant than newer things.  I don't want
to do a strict sort by date.  Is this supported somehow by using a
dismax request handler?  Or if you have other hints, I'm eager to
know what they are.


dismax handler has a bf (boosting function) parameter that may be used
to specify a function over the date field.

You could try something like setting bf to
recip(rord(mydatefield),1,1000,1000)^0.5
A reciprocal function over the reverse ordinal of the date field, with
a weight of .5 (adjust weight until you get the right balance)

http://incubator.apache.org/solr/docs/api/org/apache/solr/request/DisMaxRequestHandler.html


-Yonik