diff --git a/solr/core/src/java/org/apache/solr/search/facet/FacetFieldProcessor.java b/solr/core/src/java/org/apache/solr/search/facet/FacetFieldProcessor.java index 1ba252e3a75..e8b234d6ed0 100644 --- a/solr/core/src/java/org/apache/solr/search/facet/FacetFieldProcessor.java +++ b/solr/core/src/java/org/apache/solr/search/facet/FacetFieldProcessor.java @@ -528,9 +528,9 @@ abstract class FacetFieldProcessor extends FacetProcessor { } protected SimpleOrderedMap refineFacets() throws IOException { - List leaves = asList(fcontext.facetInfo.get("_l")); - List skip = asList(fcontext.facetInfo.get("_s")); - List missing = asList(fcontext.facetInfo.get("_m")); + List leaves = asList(fcontext.facetInfo.get("_l")); // We have not seen this bucket: do full faceting for this bucket, including all sub-facets + List skip = asList(fcontext.facetInfo.get("_s")); // We have seen this bucket, so skip stats on it, and skip sub-facets except for the specified sub-facets that should calculate specified buckets. + List missing = asList(fcontext.facetInfo.get("_m")); // We have not seen this bucket, do full faceting for this bucket, and most sub-facets... but some sub-facets should only visit specified buckets. // For leaf refinements, we do full faceting for each leaf bucket. Any sub-facets of these buckets will be fully evaluated. Because of this, we should never // encounter leaf refinements that have sub-facets that return partial results. diff --git a/solr/core/src/java/org/apache/solr/search/facet/FacetProcessor.java b/solr/core/src/java/org/apache/solr/search/facet/FacetProcessor.java index cf4d0fe9cb1..9f05d8e56f6 100644 --- a/solr/core/src/java/org/apache/solr/search/facet/FacetProcessor.java +++ b/solr/core/src/java/org/apache/solr/search/facet/FacetProcessor.java @@ -366,13 +366,9 @@ public abstract class FacetProcessor { } } - // TODO: rather than just have a raw "response", perhaps we should model as a bucket object that contains the response plus extra info? void fillBucket(SimpleOrderedMap bucket, Query q, DocSet result, boolean skip, Map facetInfo) throws IOException { - // TODO: we don't need the DocSet if we've already calculated everything during the first phase - boolean needDocSet = freq.getFacetStats().size() > 0 || freq.getSubFacets().size() > 0; - - // TODO: put info in for the merger (like "skip=true"?) Maybe we don't need to if we leave out all extraneous info? + boolean needDocSet = (skip==false && freq.getFacetStats().size() > 0) || freq.getSubFacets().size() > 0; int count;