munendrasn commented on a change in pull request #2123: URL: https://github.com/apache/lucene-solr/pull/2123#discussion_r538316824
########## File path: solr/core/src/java/org/apache/solr/request/SimpleFacets.java ########## @@ -903,7 +910,7 @@ public void execute(Runnable r) { private int numDocs(String term, final SchemaField sf, final FieldType ft, final DocSet baseDocset) { try { - return searcher.numDocs(ft.getFieldQuery(null, sf, term), baseDocset); + return baseDocset.size() == 0? 0: searcher.numDocs(ft.getFieldQuery(null, sf, term), baseDocset); Review comment: sort by count won't be done if baseDocSet size is 0 but I have kept this check in numDocs so that, any future usage can benefit from 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. 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