lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Erik Hatcher <>
Subject Re: boosting querys closer to the current date
Date Wed, 16 Nov 2005 10:35:08 GMT

On 16 Nov 2005, at 04:42, wrote:
> Providing that I have indexed documents with the following fields:
>  Keyword:   lastmodifiedDate
>  Unstored:  contents
> And that I run a simple query only using just the contents field.
> Is there anyway to change the way Lucene presents results, so  
> documents
> with a high score and lastmodifiedDate closer to today are  
> presented first?
> Note that I do not want to reverse sort by lastmodifiedDate, what I  
> want is
> to take the date into account in the scoring.

If you have a copy of "Lucene in Action", check out the TheServerSide  
case study that Dion Almaer contributed.  TSS boosts more recent  

If you're re-indexing (for example nightly, like TSS does) you can  
dynamically adjust boosts on the document based on last modified date.

If you need to boost without reindexing, I'm not quite sure what the  
best solution is - perhaps a custom Query subclass that can do this  
based on the current date?


To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message