Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id 7B292200B59 for ; Mon, 8 Aug 2016 16:36:54 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id 79C2E160A91; Mon, 8 Aug 2016 14:36:54 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id C0B29160A77 for ; Mon, 8 Aug 2016 16:36:53 +0200 (CEST) Received: (qmail 25903 invoked by uid 500); 8 Aug 2016 14:36:52 -0000 Mailing-List: contact commits-help@lucene.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@lucene.apache.org Delivered-To: mailing list commits@lucene.apache.org Received: (qmail 25894 invoked by uid 99); 8 Aug 2016 14:36:52 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 08 Aug 2016 14:36:52 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id C23EDDFC56; Mon, 8 Aug 2016 14:36:52 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: dsmiley@apache.org To: commits@lucene.apache.org Message-Id: <48f139aa4fac47d0984322dfc41f5ae9@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: lucene-solr:master: SOLR-9350: JSON Facet and method=stream: cacheDf threshold now gates use of the filter cache Date: Mon, 8 Aug 2016 14:36:52 +0000 (UTC) archived-at: Mon, 08 Aug 2016 14:36:54 -0000 Repository: lucene-solr Updated Branches: refs/heads/master 153c27004 -> b63bb5167 SOLR-9350: JSON Facet and method=stream: cacheDf threshold now gates use of the filter cache Project: http://git-wip-us.apache.org/repos/asf/lucene-solr/repo Commit: http://git-wip-us.apache.org/repos/asf/lucene-solr/commit/b63bb516 Tree: http://git-wip-us.apache.org/repos/asf/lucene-solr/tree/b63bb516 Diff: http://git-wip-us.apache.org/repos/asf/lucene-solr/diff/b63bb516 Branch: refs/heads/master Commit: b63bb5167abad6da30e09fa405f8b99e11a8ff21 Parents: 153c270 Author: David Smiley Authored: Mon Aug 8 10:36:39 2016 -0400 Committer: David Smiley Committed: Mon Aug 8 10:36:39 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/b63bb516/solr/CHANGES.txt ---------------------------------------------------------------------- diff --git a/solr/CHANGES.txt b/solr/CHANGES.txt index 3d597b7..baae0e2 100644 --- a/solr/CHANGES.txt +++ b/solr/CHANGES.txt @@ -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 ---------------------- http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/b63bb516/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;