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


##########
solr/core/src/java/org/apache/solr/search/join/FiltersQParser.java:
##########
@@ -59,7 +59,14 @@ protected BooleanQuery parseImpl() throws SyntaxError {
 
     BooleanQuery.Builder builder = createBuilder();
     for (Map.Entry<QParser, Occur> clause : clauses.entrySet()) {
-      builder.add(unwrapQuery(clause.getKey().getQuery(), clause.getValue()), 
clause.getValue());
+
+      Query query = clause.getKey().getQuery();
+      Occur occur = clause.getValue();
+
+      if (occur == Occur.SHOULD && query instanceof BooleanQuery boolQ && 
boolQ.clauses().isEmpty()) {

Review Comment:
   Ahh.  IMO it's make sense to put logic in 
`org.apache.solr.schema.TextField#getFieldQuery` which is on the call chain you 
reference.  Logic to prevent null or an empty boolean query -- either should 
simply return MatchNoDocsQuery.  Ideally the scope would be broader than this 
getFieldQuery method which is somewhat obscure and thus communicating this 
change alone would be awkward -- a clue that the scope isn't right.  It'd be 
more useful & clearer to say *any* analysis yielding no tokens results in a 
MatchNoDocsQuery, if we can make such a claim.  Of course, feel free to look 
further and propose something.



-- 
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