You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucene.apache.org by ds...@apache.org on 2016/08/08 14:38:13 UTC

lucene-solr:branch_6x: SOLR-9350: JSON Facet and method=stream: cacheDf threshold now gates use of the filter cache (cherry picked from commit b63bb51)

Repository: lucene-solr
Updated Branches:
  refs/heads/branch_6x 812dc1d0b -> 91d7b53d9


SOLR-9350: JSON Facet and method=stream: cacheDf threshold now gates use of the filter cache
(cherry picked from commit b63bb51)


Project: http://git-wip-us.apache.org/repos/asf/lucene-solr/repo
Commit: http://git-wip-us.apache.org/repos/asf/lucene-solr/commit/91d7b53d
Tree: http://git-wip-us.apache.org/repos/asf/lucene-solr/tree/91d7b53d
Diff: http://git-wip-us.apache.org/repos/asf/lucene-solr/diff/91d7b53d

Branch: refs/heads/branch_6x
Commit: 91d7b53d9c02804b02f282ff0ff403d21fa36f9b
Parents: 812dc1d
Author: David Smiley <ds...@apache.org>
Authored: Mon Aug 8 10:36:39 2016 -0400
Committer: David Smiley <ds...@apache.org>
Committed: Mon Aug 8 10:38:05 2016 -0400

----------------------------------------------------------------------
 solr/CHANGES.txt                                          |  4 ++++
 .../src/java/org/apache/solr/search/facet/FacetField.java | 10 +++++++---
 2 files changed, 11 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/91d7b53d/solr/CHANGES.txt
----------------------------------------------------------------------
diff --git a/solr/CHANGES.txt b/solr/CHANGES.txt
index 1316124..99e69f0 100644
--- a/solr/CHANGES.txt
+++ b/solr/CHANGES.txt
@@ -171,6 +171,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
 ----------------------
 

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/91d7b53d/solr/core/src/java/org/apache/solr/search/facet/FacetField.java
----------------------------------------------------------------------
diff --git a/solr/core/src/java/org/apache/solr/search/facet/FacetField.java b/solr/core/src/java/org/apache/solr/search/facet/FacetField.java
index 0e7e82a..a5ec1db 100644
--- a/solr/core/src/java/org/apache/solr/search/facet/FacetField.java
+++ b/solr/core/src/java/org/apache/solr/search/facet/FacetField.java
@@ -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;