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

BooleanQuery.rewrite does not work properly for minNumberShouldMatch

Attach filesAttach ScreenshotVotersWatch issueWatchersCreate sub-taskLinkCloneUpdate Comment AuthorReplace String in CommentUpdate Comment VisibilityDelete Comments
    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

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              shaie Shai Erera

              Dates

              • Created:
                Updated:
                Resolved:

                Issue deployment