lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Miles Barr <>
Subject Re: Timestamps as milliseconds
Date Thu, 27 Jul 2006 08:23:01 GMT
Erick Erickson wrote:

> As Miles said, use the DateTools (lucene) class with a DAY resolution.
> That'll give you a YYYYMMDD format, which won't blow your query with a
> "TooManyClauses" exception.......
> Remember that Lucene deals with strings, so you want to store things in
> easily-manipulated string format, often one that's suitable for 
> comparison.
> Which is what you want to do when you create a RangeQuery

I think this is the way to go, have one field at DAY resolution for the 
RangeQuery and one field at MILLISECOND resolution for sorting.

The reason you want the coarsest resolution possible for RangeQuerys is 
that it works the same way as any other query, it tries to match tokens. 
To do this it enumerates all possible values between the two end points, 
so if there's a week between the two dates and the resolution is DAY, 
that's just seven values it tries to match against. If the resolution is 
MILLISECOND it tries to match against 604,800,000 values.


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

View raw message