lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From stlecho <>
Subject Date Range Query: How to get a higher score for dates close to a reference date ?
Date Mon, 26 May 2008 11:21:39 GMT


In the application I'm developing I'm able to query on 2 properties of my
model: Name and BirthDay. Records that have an exact match on the name
property and for which the birthday is close to the specified BirthDay query
parameter should have a higher score.

Does Lucene support the following scenario ? The user specifies a
ReferenceDate with a Tolerance. The ReferenceDate and Tolerance are used to
query the index and get the hits. The score of the hits should be based on
the "distance" between the ReferenceDate and the BirthDay of the hit. In
other words: BirthDays that are in the specified range, but closer to the
ReferenceDate should have a higher score.

The user wants to search persons born on 2003-05-01, but with a tolerance of
5 years (because the user is no sure about the exact birthyear)
-Reference Date: 2003-05-01
-Range Query: [1998-05-01 TO 2008-05-01]
-Results with birthday 1998-05-01 should have a lower score than results
with birthday 2003-01-01 (because this date is closer to the reference date

Regards, Stefan Lecho.
View this message in context:
Sent from the Lucene - Java Users mailing list archive at

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

View raw message