lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Daniel Naber <>
Subject problems with date ranges in queryParser
Date Sun, 15 Jan 2006 21:15:38 GMT

QueryParser can parse input like [01.01.2005 TO 15.01.2005] if the German 
locale is activated ("01.01.2005" is the way 2005-01-01 is usually written 
in Germany). By "can parse" I mean that the date is recognized and 
automatically turned into the format used by DateField (like "0e9eodds0"). 
There are two problems with that:

1.) We now have DateField and DateTools which use different formats. So 
QueryParser needs to know which one has been used during indexing. I've a 
local patch that adds an appropriate set... method.

2.) Range queries with [...] are supposed to be inclusive, but that doesn't 
work as the use will expect with dates if the resolution of the query is 
less than the indexing resolution. So if someone queries for [01.01.2005 
TO 15.01.2005] he expects to get documents from 15.01.2005, too. The index 
might contain fields like 2005011520015 (i.e. 2005-01-15 20:15) for this, 
but the query is turned into [20050101 TO 20050115], so that document is 
not found.

Does anybody have any idea how to solve problem 2.? You cannot just set the 
time to 23:59:59 because with the current implementation you cannot tell 
whether the time was specified by the user.



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

View raw message