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

BooleanQuery.rewrite does not work properly for minNumberShouldMatch

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 2.4
    • Fix Version/s: None
    • Component/s: core/search
    • Labels:
      None
    • Lucene Fields:
      New, Patch Available

      Description

      BooleanQuery.rewrite does not respect minNumberShouldMatch if the number of clauses is 1. This causes inconsistencies for the queries "+def" and "+abc +def", while setting the minNumShouldMatch to '1' for both.
      For the first query, results are returned although there are no SHOULD clauses in the query.
      For the second query no results are returned.
      The reason lies in the optimization BooleanQuery.rewrite has for one clauses queries.
      Patch included - optimize the query for a single clause only if the minNumShouldMatch <= 0.

        Attachments

        1. LUCENE-1134.patch
          1 kB
          Shai Erera

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              shaie Shai Erera
            • Votes:
              1 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: