On Aug 30, 2008, at 3:14 PM, Andrzej Bialecki wrote:
Matt Ronge wrote:
Hi all,
I am working on implementing a new Query, Weight and Scorer that is
expensive to run. I'd like to limit the number of documents I run
this query on by first building a candidate set of documents with a
boolean query. Once I have that candidate set, I was hoping I could
build a filter off of it, and issue that along with my expensive
query. However, after reading the code I see that filtering is done
during the search, and not before hand. So my initial boolean query
won't help in limiting the number of documents scored by my
expensive query.
Has anyone done any work into restricting the set of docs that a
query operates on?
Or should I just implement something myself in a custom scorer?
I think you can use a FilteredQuery in a BooleanClause. This may be
faster than the filtering code in the Searcher, because the
evaluation is done during scoring and not afterwards. FilteredQuery
internally makes
FYI, not sure if this is exactly what you are talking about Andrzej,
but IndexSearcher no longer filters after scoring. This was changed
in https://issues.apache.org/jira/browse/LUCENE-584
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]