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


##########
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:
   I don't think org.apache.solr.schema.TextField#getFieldQuery is called, the 
call stack to arrive at org.apache.lucene.util.QueryBuilder#createFieldQuery is:
   
   ```
   at 
org.apache.lucene.util.QueryBuilder.createFieldQuery(QueryBuilder.java:257)
   at 
org.apache.solr.parser.SolrQueryParserBase.newFieldQuery(SolrQueryParserBase.java:529)
   at org.apache.solr.parser.QueryParser.newFieldQuery(QueryParser.java:68)
   at 
org.apache.solr.parser.SolrQueryParserBase.getFieldQuery(SolrQueryParserBase.java:1122)
   at 
org.apache.solr.parser.SolrQueryParserBase.handleBareTokenQuery(SolrQueryParserBase.java:861)
   at org.apache.solr.parser.QueryParser.Term(QueryParser.java:454)
   at org.apache.solr.parser.QueryParser.Clause(QueryParser.java:293)
   at org.apache.solr.parser.QueryParser.Query(QueryParser.java:173)
   at org.apache.solr.parser.QueryParser.TopLevelQuery(QueryParser.java:143)
   at 
org.apache.solr.parser.SolrQueryParserBase.parse(SolrQueryParserBase.java:276)
   at org.apache.solr.search.LuceneQParser.parse(LuceneQParser.java:51)
   at org.apache.solr.search.QParser.getQuery(QParser.java:197)
   at 
org.apache.solr.search.join.FiltersQParser.parseImpl(FiltersQParser.java:64)
   at 
org.apache.solr.search.BoolQParserPlugin$1.parseImpl(BoolQParserPlugin.java:52)
   at 
org.apache.solr.search.BoolQParserPlugin$1.parse(BoolQParserPlugin.java:47)
   at org.apache.solr.search.QParser.getQuery(QParser.java:197)
   at 
org.apache.solr.search.TestMmBoolQParserPlugin.parseQuery(TestMmBoolQParserPlugin.java:49)
   at 
org.apache.solr.search.TestMmBoolQParserPlugin.testMinShouldMatchThresholdsLower(TestMmBoolQParserPlugin.java:103)
   ```
   From what you are saying, it wouldn't be sufficient to just check if  
org.apache.lucene.util.QueryBuilder.createFieldQuery(QueryBuilder.java:257) 
returns null and then return MatchNoDocsQuery instead of passing null up the 
stack?
   



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