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

BooleanQuery with needsScores=false, rewriteNoScoring improvement

    XMLWordPrintableJSON

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 7.3, 8.0
    • Component/s: None
    • Labels:
      None
    • Lucene Fields:
      New, Patch Available

      Description

      In the case needsScores=false, createWeight calls rewriteNoScoring before creating a new BooleanWeight. This in all cases creates a new BooleanQuery, even when it's not necessary (aka there are no MUST clauses).

      The rewriteNoScoring method could check for something as simple as if (clauseSets.get(Occur.MUST).size() > 0) before creating a brand new BooleanQuery.

        Attachments

        1. LUCENE-8127.patch
          0.7 kB
          Michael Braun

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              mbraun688 Michael Braun
            • Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: