lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Erik Hatcher <>
Subject Re: Numeric Range Restrictions: Queries vs Filters
Date Tue, 23 Nov 2004 13:24:49 GMT

On Nov 22, 2004, at 9:25 PM, Hoss wrote:
> I'm rather new to Lucene (and this list), so if I'm grossly
> misunderstanding things, forgive me.

You're spot on!

> But I was surprised then to see the following quote from "Erik 
> Hatcher" in
> the archives:
>   "In fact, DateFilter by itself is practically of no use, I think." 
> [4]
> ...Erik goes on to suggest that given "a set of canned date ranges", it
> doesn't really matter if you use a RangeQuery or a DateFilter -- as 
> long
> as you cache them to reuse them (with something like 
> CachingWrappingFilter
> or QueryFilter).  I'm hoping that he might elaborate on that comment?

RangeQuery wrapped inside a QueryFilter is more specifically what I 
said.  I'm not a fan of DateField and how the built-in date support in 
Lucene works, so this is why I don't like DateFilter personally.

Your RangeFilter, however, is nicely done and well worth deprecating 
DateFilter for.

> As a test, I wrote a "RangeFilter" which borrows heavily from 
> DateFilter
> to both convince myself it could work, and to do a comparison between 
> it
> and RangeQuery. [5] Based on my limited tests, using a Filter to 
> restrict
> to a Range is a lot faster then using RangeQuery -- independent of
> caching.

And now with FilteredQuery you can have the best of both worlds :)

Thanks for your detailed code, tests, and contribution.  We'll fold it 


To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message