lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Erik Hatcher <>
Subject Re: slow performance with Date Range Searching
Date Wed, 17 Sep 2003 16:14:55 GMT
And with the latest Lucene codebase in CVS, you could also use a 
DateFilter wrapped inside a CachingWrapperFilter instead of a 
QueryFilter.  Just wanted to mention what is now available.

But I'll reiterate what Doug says... be sure to save off the filter 
instance so you don't take the filtering performance hit for the same 
date ranges on later searches.


On Wednesday, September 17, 2003, at 11:57  AM, Doug Cutting wrote:

> 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.
> Doug
> ---------------------------------------------------------------------
> To unsubscribe, e-mail:
> For additional commands, e-mail:

View raw message