Lucene - Core
  1. Lucene - Core
  2. LUCENE-4571

speedup disjunction with minShouldMatch

    Details

    • Type: Improvement Improvement
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 4.1
    • Fix Version/s: 4.3, Trunk
    • Component/s: core/search
    • Labels:
      None
    • Lucene Fields:
      New

      Description

      even minShouldMatch is supplied to DisjunctionSumScorer it enumerates whole disjunction, and verifies minShouldMatch condition on every doc:

        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;
        }
      

      Stefan Pohl 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.

      1. LUCENE-4571.patch
        12 kB
        Stefan Pohl
      2. LUCENE-4571.patch
        19 kB
        Robert Muir
      3. LUCENE-4571.patch
        15 kB
        Robert Muir
      4. LUCENE-4571.patch
        15 kB
        Stefan Pohl
      5. LUCENE-4571.patch
        18 kB
        Stefan Pohl
      6. LUCENE-4571.patch
        17 kB
        Stefan Pohl
      7. LUCENE-4571.patch
        18 kB
        Stefan Pohl

        Activity

          People

          • Assignee:
            Unassigned
            Reporter:
            Mikhail Khludnev
          • Votes:
            1 Vote for this issue
            Watchers:
            11 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development