On Mar 29, 2004, at 8:41 AM, Erik Hatcher wrote:
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.

One more point... caching is done by the IndexReader used for the search, so you will need to keep that instance (i.e. the IndexSearcher) around to benefit from the caching.


Erik


--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to