From 6f786dd5976481157c2d9ffd8c8550fe91f81990 Mon Sep 17 00:00:00 2001 From: Clay Goddard Date: Wed, 6 Dec 2023 17:04:06 -0500 Subject: [PATCH] Reset cached results on merge. (#175) Must reset cached results on merge for refinement. --- solr/core/src/java/org/apache/solr/search/facet/HLLAgg.java | 1 + .../src/java/org/apache/solr/search/facet/PercentileAgg.java | 1 + solr/core/src/java/org/apache/solr/search/facet/UniqueAgg.java | 1 + 3 files changed, 3 insertions(+) diff --git a/solr/core/src/java/org/apache/solr/search/facet/HLLAgg.java b/solr/core/src/java/org/apache/solr/search/facet/HLLAgg.java index 62382cbe007..f85b0e5d610 100644 --- a/solr/core/src/java/org/apache/solr/search/facet/HLLAgg.java +++ b/solr/core/src/java/org/apache/solr/search/facet/HLLAgg.java @@ -119,6 +119,7 @@ public void merge(Object facetResult, Context mcontext) { } else { aggregate.union(subHLL); } + answer = -1; } private long getLong() { diff --git a/solr/core/src/java/org/apache/solr/search/facet/PercentileAgg.java b/solr/core/src/java/org/apache/solr/search/facet/PercentileAgg.java index 6c0c3db02ba..0ac1461e355 100644 --- a/solr/core/src/java/org/apache/solr/search/facet/PercentileAgg.java +++ b/solr/core/src/java/org/apache/solr/search/facet/PercentileAgg.java @@ -523,6 +523,7 @@ public void merge(Object facetResult, Context mcontext) { } else { digest.add(subDigest); } + sortVal = null; } @Override diff --git a/solr/core/src/java/org/apache/solr/search/facet/UniqueAgg.java b/solr/core/src/java/org/apache/solr/search/facet/UniqueAgg.java index 1f41617dd2e..7f1a9caeb51 100644 --- a/solr/core/src/java/org/apache/solr/search/facet/UniqueAgg.java +++ b/solr/core/src/java/org/apache/solr/search/facet/UniqueAgg.java @@ -98,6 +98,7 @@ public void merge(Object facetResult, Context mcontext) { shardsMissingSum += unique - valsListed; shardsMissingMax = Math.max(shardsMissingMax, unique - valsListed); // TODO: somehow get & use the count in the bucket? + answer = -1; } private long getLong() {