lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Doug Cutting <>
Subject Re: slow performance with Date Range Searching
Date Wed, 17 Sep 2003 15:57:06 GMT
Killeen, Tom wrote:
> My query would look something like this: LongTitle:killeen AND
> LongTitle:state AND StateDistrict:id AND FiledDate:["1997-01-01" TO
> "2002-04-04"] and it returned in 
> 5.7 seconds
> Does anyone have any suggestions for searching date ranges.  Our ranges will
> generally be between a 3 - 7 year period.

If you use the same date range repeatedly then you can make things fast 
by replacing it with a filter that you re-use.  Try using a QueryFilter 
with your date range query as the query.  Save the QueryFilter object 
and use it again with future queries.  The first query will be slow, but 
subsequent queries will use the cached results of the first.

This is the recommended way to implement a "within the last month", 
"within the last year", etc. feature.  You could even pre-fetch the 
filter whenever you update the index, by evaluating a query before you 
put a new IndexReader in production, so that even the first real user 
query is fast.


View raw message