lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Erik Hatcher <>
Subject Re: DateFilter or RangeQuery
Date Thu, 04 Dec 2003 16:14:29 GMT

On Thursday, December 4, 2003, at 10:16  AM, Maxim Patramanskij wrote:
> What is the better way to filter search results by date (which is one
> of the indexed fields):
>   - use RangeQuery against date field as a required part of boolean  
> query;
>   - use DateFilter
>   First approach seems to be problematic since I have to extremely
>   increase maxClauseCount of BooleanQuery and run again extra memory
>   usage.

DateFilter will be the better option if you do use the same date range 
filter repeatedly - just keep the instance around and re-use it.

A more general question, though, is are you truly just representing 
dates? (and not timestamps)  If so, how many different dates are in the 

If you are just using dates, I recommend using "YYYYMMDD" formatted 
Field.Keyword(String, String) fields.  Don't use java.util.Date.  
You'll get far fewer terms if you are just representing dates, and 
RangeQuery might become a more viable option for you.


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

View raw message