lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Chris Hostetter <>
Subject Re: Non-scoring fields
Date Tue, 25 Oct 2005 21:13:23 GMT

: > You can also use a filter to filter your results. As far as I know
: > Filter does not effect the score
: Yes, but wouldn't a filter be at least a little slower in this simple case?
: Perhaps I should just do a few timing tests...

There is nothing intrinsic in the way Filters work that make them slower
then Queries -- in the case of RangeQuery vs RangeFilter, a RangeFilter is
just about always faster then a RangeQuery.  (or more specifically: I've
never seen a case in which a RangeQuery is faster)

In your case, it sounds like what you want is a simple "TermFilter" -- a
class by that name doesn't exist, but you can use RangeFilter (just set
both ends of the range to be the same group that you want to restrict to)
to get the same effect.

The added bonus of using a Filter, is that the results can be cached for
as long as the IndexReader used is open, which means everytime someone
from the same group does a search, the info about what docs that group
can look at is reused -- even if the searches are different every time.

(see CachingWrapperFilter for one example of how to do this)


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

View raw message