cpoerschke commented on a change in pull request #1407: Use QueryUtils.combineQueryAndFilter more URL: https://github.com/apache/lucene-solr/pull/1407#discussion_r406354417
########## File path: solr/core/src/java/org/apache/solr/search/QueryUtils.java ########## @@ -151,7 +151,7 @@ public static BooleanQuery build(BooleanQuery.Builder builder, QParser parser) { * If neither are null then we combine with a BooleanQuery. */ public static Query combineQueryAndFilter(Query scoreQuery, Query filterQuery) { - if (scoreQuery == null) { + if (scoreQuery == null || scoreQuery instanceof MatchAllDocsQuery) { Review comment: An alternative to a comment could be to include it in the method's javadocs, though perhaps it's more of an implementation detail thingy. edge case: if `scoreQuery is a MatchAllDocsQuery (which implies it's non-null)` and `filterQuery is null` then would it make sense to return `scoreQuery` itself rather than the current `return new MatchAllDocsQuery();` at line 156? ---------------------------------------------------------------- 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. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services --------------------------------------------------------------------- To unsubscribe, e-mail: issues-unsubscr...@lucene.apache.org For additional commands, e-mail: issues-h...@lucene.apache.org