epotyom commented on code in PR #16667:
URL: https://github.com/apache/lucene/pull/16667#discussion_r4054932820


##########
lucene/core/src/java/org/apache/lucene/search/BooleanQuery.java:
##########
@@ -369,6 +369,18 @@ public Query rewrite(IndexSearcher indexSearcher) throws 
IOException {
       if 
(mustNotClauses.stream().anyMatch(p.or(clauseSets.get(Occur.FILTER)::contains)))
 {
         return new MatchNoDocsQuery("FILTER or MUST clause also in MUST_NOT");
       }
+      for (Query q : clauseSets.get(Occur.MUST)) {

Review Comment:
   Good idea, I've merged with the MUST check above. As for FILTER, if I 
understand correctly there is no need to unwrap boost or constant score query 
for this case as they are unwrapped already (lines 310-313), but I've added a 
test to make sure it stays this way (see the first added assert 
[here](https://github.com/apache/lucene/pull/16667/changes#diff-ded67a199416417d9b2c0c354e1db608ed0d79bf1d745390e5723f0b801861d3R297)),
 wdyt?



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to