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: Is RangeQuery more efficient than DateFilter?
Date Mon, 29 Mar 2004 13:41:10 GMT
On Mar 29, 2004, at 4:25 AM, Kevin A. Burton wrote:
> I have a 7G index.  A query for a random term comes back fast (300ms) 
> when I'm not using a DateFilter but when I add the DateFilter it takes 
> 2.6 seconds.  Way too long.  I assume this is because the filter API 
> does a post process so it has to read fields off disk.
>
> Is it possible to do to this with a RangeQuery.  For example you could 
> create a "days since January 1, 1970" fields and do a range query from 
> between 5 and 10... and then add the original field as well.

Are you keeping DateFilter around for more than one search?  The 
drawback to pure DateFilter is that it does not cache, so each search 
re-enumerates the terms in the range.  In fact, DateFilter by itself is 
practically of no use, I think.

If you have a set of canned date ranges, there are two approaches worth 
considering:  DateFilter wrapped by a CachingWrappingFilter, or a 
RangeQuery wrapped in a QueryFilter (which does cache).

Performance-wise, I don't really think there is much (any?) difference 
in these two approaches, so take your pick.  Once the bit sets are 
cached in a filter, searches will be quite fast.

	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