lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Martin Sevigny" <>
Subject Filters, range queries and MultiSearcher
Date Sun, 23 Feb 2003 11:45:52 GMT

Looking (and testing) range queries (in particular date interval
queries), I think there is a problem with how Lucene handles filters
when a multisearcher is used.

Basically, a Filter is created from a Reader, so only one searchable
index. It creates a BitSet for documents in this index that matches the
filter criteria. Fine.

Then, the Searchable interface has a search(Query query, Filter filter,
HitCollector results) method. So if a call is made to this method
through a MultiSearcher object, then we have code (in the search method)
such as:

    for (int i = 0; i < searchables.length; i++) {

      final int start = starts[i];

      searchables[i].search(query, filter, new HitCollector() {
	  public void collect(int doc, float score) {
	    results.collect(doc + start, score);


Here, clearly, the search is performed in each Searchable with the same
Filter. This filter has been created with (one must assume) one of the
Searchables, so the BitSet is probably wrong for the others, resulting
in wrong results.

Is taht right?

If so, what's the best solution?

I'm thinking of something like a "MultFilter" for Filter on multiple
searchables, does this makes sense?

We could also think of a method search which takes a Filter[] parameter
instead of Filter, but this doesn't fit well in the architecture.

Any other solutions?

Is it something already addressed (didn't find anything)?

Thank's for any input. If the solutions above seem OK, we could
implement one of them and contribute it to Lucene.

Martin Sévigny

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

View raw message