nick-boss-tech commented on code in PR #5377:
URL: https://github.com/apache/solr/pull/5377#discussion_r4656570632


##########
solr/core/src/java/org/apache/solr/search/QueryUtils.java:
##########
@@ -181,33 +179,54 @@ public static Query getAbs(Query q) {
     }
   }
 
-  /** Makes negative queries suitable for querying by lucene. */
+  /**
+   * Unwraps {@link WrappedQuery} and also fixes negative queries. The 
WrappedQuery's cache/cost
+   * hints are dropped; they only matter at the root of the final query, which 
{@link
+   * QParser#getQuery()} handles. Suitable for a query parser or right before 
a query is processed
+   * by {@link SolrIndexSearcher} or other low-level plumbing.
+   */
   public static Query makeQueryable(Query q) {
-    if (q instanceof WrappedQuery) {
-      return makeQueryable(((WrappedQuery) q).getWrappedQuery());
-    }
-    return isNegative(q) ? fixNegativeQuery(q) : q;
+    return switch (q) {

Review Comment:
   🤖 *AI text below* 🤖
   
   Could this preserve the previous null behavior? 
`SolrQueryParser.getBooleanQuery` can pass null when no clauses remain, but 
this switch throws before reaching `default`. The CI failures include a DisMax 
request for `q=quick`, where parsing an optional phrase query reaches this 
path. Could we handle null and add coverage for it?



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