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

BooleanQuery.rewrite does not work properly for minNumberShouldMatch

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Minor
    • Resolution: Fixed
    • 2.4
    • None
    • core/search
    • None
    • 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

            Unassigned Unassigned
            shaie Shai Erera
            Votes:
            1 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: