Sean, I was thinking about something like what you describe:

I index the articles in realtime basically, so the dates are pretty much "right now". But can I compare the dates to a start date such as 2000-01-01 and set the boost to the diffenrence between the dates? This will make the boost number higher as time goes but will that be a problem?

Another solution would be to re-index all the documents and calculate new date boost each time.. but i guess that will be a big thing.

Moray: Will the range queries affect the performance?

Lets say that I want to boost all articles that are one week old with 5 and all that are one month old with 2 and leave all the rest.

Thanks for your input!

//Rob




Sean Carpenter wrote:
Rob,
We use the opposite approach and use a lower boost value during
indexing for older documents (which makes newer ones score higher).

When adding the document to the index, you can call Document.SetBoost
(http://lucene.apache.org/java/2_3_1/api/core/org/apache/lucene/document/Document.html#setBoost(float))
to set the overall document's boost factor.  We use a pre-defined
scale based on the age of the document something like: less than 3
months = boost 1, 3 - 6 months = boost 0.8, 6 - 12 months = boost 0.4,
etc.

Sean

On Tue, Jul 21, 2009 at 10:50 AM, Robert Pohl<[email protected]> wrote:
Hi,

I have a lot of articles indexed with title, body and date.
How can I boost the dates so that the most recent articles have higher score
than the older ones?

Thanks,
Rob



Reply via email to