[ https://issues.apache.org/jira/browse/LUCENE-1134?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12559360#action_12559360 ]
Shai Erera commented on LUCENE-1134: ------------------------------------ Hi W.r.t. testing, I found TestBooleanMinShouldMatch. It had testNoOptionalButMin which added two MUST clauses. I added testNoOptionalButMin2 that adds only a single clause. It fails without the patch and passes with the patch. Other than that the tests in this class pass. I updated the patch to include the additional test. W.r.t. the optimization that was discussed: I don't understand how it can be done. BooleanQuery has a clauses list. It is not aware of any SHOULD, MUST or MUST_NOT clauses in its rewrite() method. So how exactly this optimization can be done? The only class that seems to be aware of the type of clauses is BooleanScorer2 in its add() method. > BooleanQuery.rewrite does not work properly for minNumberShouldMatch > -------------------------------------------------------------------- > > Key: LUCENE-1134 > URL: https://issues.apache.org/jira/browse/LUCENE-1134 > Project: Lucene - Java > Issue Type: Bug > Components: Search > Affects Versions: 2.4 > Reporter: Shai Erera > Priority: Minor > Attachments: LUCENE-1134.patch > > > 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. -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online. --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]