mirror of https://github.com/apache/lucene.git
SOLR-9350: JSON Facet and method=stream: cacheDf threshold now gates use of the filter cache
This commit is contained in:
parent
153c270045
commit
b63bb5167a
|
@ -205,6 +205,10 @@ Optimizations
|
|||
* SOLR-9335: Solr cache/search/update stats counters now use LongAdder which are supposed to have higher throughput
|
||||
under high contention. (Varun Thacker)
|
||||
|
||||
* SOLR-9350: JSON Facets: method="stream" will no longer always uses & populates the filter cache, likely
|
||||
flushing it. 'cacheDf' can be configured to set a doc frequency threshold, now defaulting to 1/16th doc count.
|
||||
Using -1 Disables use of the cache. (David Smiley, yonik)
|
||||
|
||||
Other Changes
|
||||
----------------------
|
||||
|
||||
|
|
|
@ -839,9 +839,13 @@ class FacetFieldProcessorStream extends FacetFieldProcessor implements Closeable
|
|||
createAccs(-1, 1);
|
||||
|
||||
// Minimum term docFreq in order to use the filterCache for that term.
|
||||
int defaultMinDf = Math.max(fcontext.searcher.maxDoc() >> 4, 3); // (minimum of 3 is for test coverage purposes)
|
||||
int minDfFilterCache = freq.cacheDf == 0 ? defaultMinDf : freq.cacheDf;
|
||||
if (minDfFilterCache == -1) minDfFilterCache = Integer.MAX_VALUE; // -1 means never cache
|
||||
if (freq.cacheDf == -1) { // -1 means never cache
|
||||
minDfFilterCache = Integer.MAX_VALUE;
|
||||
} else if (freq.cacheDf == 0) { // default; compute as fraction of maxDoc
|
||||
minDfFilterCache = Math.max(fcontext.searcher.maxDoc() >> 4, 3); // (minimum of 3 is for test coverage purposes)
|
||||
} else {
|
||||
minDfFilterCache = freq.cacheDf;
|
||||
}
|
||||
|
||||
docs = fcontext.base;
|
||||
fastForRandomSet = null;
|
||||
|
|
Loading…
Reference in New Issue