lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Mikhail Khludnev (Commented) (JIRA)" <>
Subject [jira] [Commented] (LUCENE-2686) DisjunctionSumScorer should not call .score on sub scorers until consumer calls .score
Date Tue, 17 Apr 2012 12:27:19 GMT


Mikhail Khludnev commented on LUCENE-2686:


I used this patch not by applying directly, but introducing ShouldQuery in my codebase which
extends BQ and provides "steady"child scorers for disjunction. It works great, but one tests
are spinning in infinite loop. My amendment breaks possible infinite loop in constant query


 	protected boolean score(Collector collector, int max, int firstDocID) throws IOException
 	if (docIdSetIterator instanceof Scorer) {
 	final boolean score = ((Scorer) docIdSetIterator).score(wrapCollector(collector), max, firstDocID);
         // let's break the loop
         final boolean result = score && ( docIdSetIterator.docID() != NO_MORE_DOCS);
 	return result;
 	} else {
 	return super.score(collector, max, firstDocID);

> DisjunctionSumScorer should not call .score on sub scorers until consumer calls .score
> --------------------------------------------------------------------------------------
>                 Key: LUCENE-2686
>                 URL:
>             Project: Lucene - Java
>          Issue Type: Bug
>          Components: core/search
>            Reporter: Michael McCandless
>            Assignee: Michael McCandless
>             Fix For: 4.0
>         Attachments: LUCENE-2686.patch, LUCENE-2686.patch,
> Spinoff from java-user thread "question about Scorer.freq()" from Koji...
> BooleanScorer2 uses DisjunctionSumScorer to score only-SHOULD-clause boolean queries.
> But, this scorer does too much work for collectors that never call .score, because it
scores while it's matching.  It should only call .score on the subs when the caller calls
its .score.
> This also has the side effect of messing up advanced collectors that gather the freq()
of the subs (using LUCENE-2590).

This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators:!default.jspa
For more information on JIRA, see:


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

View raw message