Issue Details (XML | Word | Printable)

Key: LUCENE-1134
Type: Bug Bug
Status: Resolved Resolved
Resolution: Fixed
Priority: Minor Minor
Assignee: Unassigned
Reporter: Shai Erera
Votes: 1
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
Lucene - Java

BooleanQuery.rewrite does not work properly for minNumberShouldMatch

Created: 15/Jan/08 07:08 PM   Updated: 03/Feb/08 08:21 AM
Return to search
Component/s: Search
Affects Version/s: 2.4
Fix Version/s: None

Time Tracking:
Not Specified

File Attachments:
  Size
Text File Licensed for inclusion in ASF works LUCENE-1134.patch 2008-01-16 06:07 AM Shai Erera 1 kB

Lucene Fields: Patch Available, New
Resolution Date: 03/Feb/08 08:21 AM


 Description  « Hide
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.

 All   Comments   Work Log   Change History   Subversion Commits      Sort Order: Ascending order - Click to sort in descending order
No work has yet been logged on this issue.