lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Erik Hatcher <e...@ehatchersolutions.com>
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 
index?

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.

	Erik


---------------------------------------------------------------------
To unsubscribe, e-mail: lucene-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: lucene-user-help@jakarta.apache.org


Mime
View raw message