risdenk commented on code in PR #2218:
URL: https://github.com/apache/solr/pull/2218#discussion_r1466558575
##########
solr/core/src/java/org/apache/solr/search/ExtendedDismaxQParser.java:
##########
@@ -199,6 +199,18 @@ public Query parse() throws SyntaxError {
topQuery = FunctionScoreQuery.boostByValue(topQuery,
boosts.get(0).asDoubleValuesSource());
}
+ // If topQuery is a boolean query, unwrap the boolean query to check if it
is just
+ // a MatchAllDocsQuery. Using MatchAllDocsQuery by itself enables later
optimizations
+ if (topQuery instanceof BooleanQuery) {
+ BooleanQuery topQueryBoolean = (BooleanQuery) topQuery;
+ if (topQueryBoolean.clauses().size() == 1) {
+ Query onlyQuery = topQueryBoolean.clauses().get(0).getQuery();
+ if (onlyQuery instanceof MatchAllDocsQuery) {
Review Comment:
There are probably other cases besides `MatchAllDocsQuery` that could be
unwrapped here. Another example being `ConstantScoreQuery`.
--
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]