You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@lucene.apache.org by Dmitry Serebrennikov <dm...@earthlink.net> on 2001/10/12 22:53:30 UTC
Question about Filter
I though I understood the Filter idea, but it turns out that I had not.
I checked the FAQ and found no useful information in there... Can anyone
provide more information on how it is supposed to be used, please?
Here's what I thought:
- that Filter contains a BitVector that could be used to
"pre-select" documents by number, so that some documents could be
quickly excluded without even evaluating the query on them.
- that a Filter can be created once (expensive) and then be used
with multiple queries (cheap)
The first point seems true, but the second I'm not sure about. The
Filter's interface provides a BitVector given an IndexReader. This seems
to mean that I have to re-create the BitVector every time... Maybe, I'm
supposed to remember the bitVectors created inside the filter (keyed by
IndexReader) and then check if IndexReader has been updated since I last
saw it? Is this the idea? In that case we probably need a lastModified()
method on the IndexReader. The ones that are there are static and
require a Directory or a file.