You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@solr.apache.org by "renatoh (via GitHub)" <gi...@apache.org> on 2026/07/01 06:43:31 UTC

Re: [PR] skip empty clause for mm count in BoolQParserPlugin [solr]

renatoh commented on code in PR #4475:
URL: https://github.com/apache/solr/pull/4475#discussion_r3503792395


##########
solr/core/src/java/org/apache/solr/util/SolrPluginUtils.java:
##########
@@ -596,7 +596,9 @@ public static void setMinShouldMatch(BooleanQuery.Builder q, String spec, boolea
             optionalDismaxClauses++;
           }
         } else {
-          if (!(c.query() instanceof MatchNoDocsQuery)) optionalClauses++;
+          if (!(mmAutoRelax && (c.query() instanceof MatchNoDocsQuery))) {

Review Comment:
   > Can you give an example of a use case you were thinking of?
   @janhoy 
   So if we search for "the brown fox" like this using the BoolQParser: mm=-1 should=field1:the should=field1:brown should=field1:fox, if 'the' is removed by the analyzer and the first should becomes an empty clause, what is mm now? 2, counting the empty clause, or 1 not counting the empty clause.
   My interpretation of mm.autoRelax in the context of the BoolQParser was, that it controls if empty clauses are counted or not for mm. 
   



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@solr.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@solr.apache.org
For additional commands, e-mail: issues-help@solr.apache.org