mirror of https://github.com/apache/lucene.git
SOLR-10727: SolrIndexSearcher.numDocs empty docSet optimization
This commit is contained in:
parent
85c1319c76
commit
715d8b0ccf
|
@ -148,6 +148,9 @@ Optimizations
|
|||
string fields from the FieldCache, resulting in up to 56% better throughput for those cases.
|
||||
(yonik)
|
||||
|
||||
* SOLR-10727: Avoid polluting the filter cache for certain types of faceting (typically ranges) when
|
||||
the base docset is empty. (David Smiley)
|
||||
|
||||
Other Changes
|
||||
----------------------
|
||||
* SOLR-10236: Removed FieldType.getNumericType(). Use getNumberType() instead. (Tomás Fernández Löbbe)
|
||||
|
|
|
@ -2033,6 +2033,9 @@ public class SolrIndexSearcher extends IndexSearcher implements Closeable, SolrI
|
|||
* If there is a low-level I/O error.
|
||||
*/
|
||||
public int numDocs(Query a, DocSet b) throws IOException {
|
||||
if (b.size() == 0) {
|
||||
return 0;
|
||||
}
|
||||
if (filterCache != null) {
|
||||
// Negative query if absolute value different from original
|
||||
Query absQ = QueryUtils.getAbs(a);
|
||||
|
|
Loading…
Reference in New Issue