benwtrent commented on code in PR #13033: URL: https://github.com/apache/lucene/pull/13033#discussion_r1466767966
########## lucene/core/src/java/org/apache/lucene/search/PointRangeQuery.java: ########## @@ -290,6 +290,24 @@ public ScorerSupplier scorerSupplier(LeafReaderContext context) throws IOExcepti return null; } + if (values.getDocCount() == 0) { + return null; + } else { Review Comment: From what I can tell, `ScorerSupplier` is an optional interface, which is probably just fine for most things (I am unsure which queries satisfy it or if we care). I am not 100% sure the expensive part we are trying to bypass. But in a `BooleanQuery`, if we hit an "expensiveScorerSupplier" first, we will call `scorerSupplier.cost()` on that "expensiveScorerSupplier". If this is fine & still allows for the biggest optimizations (bypassing `scorerSupplier.get(leadCost)`), then this solution is rather nice! -- 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: issues-unsubscr...@lucene.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: issues-unsubscr...@lucene.apache.org For additional commands, e-mail: issues-h...@lucene.apache.org