lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Robert Muir (JIRA)" <>
Subject [jira] [Commented] (LUCENE-4571) speedup disjunction with minShouldMatch
Date Thu, 21 Feb 2013 02:42:13 GMT


Robert Muir commented on LUCENE-4571:

But given that this new scorer drastically speeds up the BS2 case in the highly
restrictive cases, and only slows it down a bit for the other cases, I
think we should commit the new scorer, and then separately iterate on
the heuristics for when to choose which sub scorer?

I think so too. I am jetlagged so will spend lots of time reviewing the patch tomorrow morning.

I do think we should fix our DisjunctionSumScorer to no longer do minShouldMatch and use it
for mm=1
as indicated by Stefan in his comment. This would remove all the XXX0 cases from being slower
either being the same or slightly faster. :)

Separately I can't help but be curious how the patch would perform if we combined it with
patch (as we know this significantly helped conjunctions). As Stefan's TODO indicates, this
reduce some of the cpu overhead of this in some of the worst cases as well, and I think the

performance would all look just fine.

> speedup disjunction with minShouldMatch 
> ----------------------------------------
>                 Key: LUCENE-4571
>                 URL:
>             Project: Lucene - Core
>          Issue Type: Improvement
>          Components: core/search
>    Affects Versions: 4.1
>            Reporter: Mikhail Khludnev
>         Attachments: LUCENE-4571.patch
> even minShouldMatch is supplied to DisjunctionSumScorer it enumerates whole disjunction,
and verifies minShouldMatch condition [on every doc|]:
> {code}
>   public int nextDoc() throws IOException {
>     assert doc != NO_MORE_DOCS;
>     while(true) {
>       while (subScorers[0].docID() == doc) {
>         if (subScorers[0].nextDoc() != NO_MORE_DOCS) {
>           heapAdjust(0);
>         } else {
>           heapRemoveRoot();
>           if (numScorers < minimumNrMatchers) {
>             return doc = NO_MORE_DOCS;
>           }
>         }
>       }
>       afterNext();
>       if (nrMatchers >= minimumNrMatchers) {
>         break;
>       }
>     }
>     return doc;
>   }
> {code}
> [~spo] proposes (as well as I get it) to pop nrMatchers-1 scorers from the heap first,
and then push them back advancing behind that top doc. For me the question no.1 is there a
performance test for minShouldMatch constrained disjunction. 

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

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

View raw message