Uploaded image for project: 'Lucene - Core'
  1. Lucene - Core
  2. LUCENE-4571

speedup disjunction with minShouldMatch

Details

    • Improvement
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 4.1
    • 4.3, 6.0
    • core/search
    • None
    • 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;
        }
      

      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.

      Attachments

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

        Activity

          People

            Unassigned Unassigned
            mkhl Mikhail Khludnev
            Votes:
            1 Vote for this issue
            Watchers:
            11 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: