On Thu, 26 Jan 2006 11:33:50 -0800 (PST)
Chris Hostetter <[EMAIL PROTECTED]> wrote:

> 
> : It seems your interface requires that the SearchFilter know all of the query
> : results before hand. I am not sure this works well with the partial result
> : sets that Lucene supports.
> 
> No, I'm not suggesting that.  I'm saying that the SearchFilter would act
> as an iterator over the doc ids that pass the filter -- regardless of the
> what query might have been doen (in my work, i accutally use Filter's
> without Queries quite a bit).
> 
> My point was that with the interface you suggested, a searcher would have
> to Score every doc, and then ask the SearchFilter if it should be included
> in the results -- which could result in a lot of docs being scored
> unneccessarily.  I was suggesting an interface that would allow the
> searcher to first ask the filter "what is the lowest doc id that you
> allow?" score that doc, then say "what is the next doc id you allow?" and
> score that one.
> 
Hmm. I don't understand enough of lucenes internals but I always thought 
that the query selects the relevant documents.
What you suggest sounds a bit like interchanging query and filter.

What's preferable depends on the concrete situation I guess. For a 
filter accepting only very few documents and a query matching a large
part of the index your way of using the filter first seems preferable.
OTOH for a filter accepting most documents and a query matching just
a few, I don't see why scoring each document that matches the filter
should be of advantage.
Especially if the filter has to do some calculation for each document in
question.

> Now that i write it out, i realize i'm bascially arguing for a Filter API
> that looks a lot like the Scorer API -- just without the score method.
> 
> Perhaps that's the best way to go: a generic "DocIterator" interface that
> could be implimented by Scorer out of the box....
> 
>      public interface DocIterator {
>          public int doc();
>          public boolean next();
>          public boolean skipTo(int target);
>      }
> 
But couldn't such a filter be implemented as a query returning some constant
score then?

Morus

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

Reply via email to