SOLR-7452: facet refinement - don't generate domain if skipping bucket

This commit is contained in:
yonik 2017-03-22 19:53:50 -04:00
parent 8a99675392
commit 725cd4e2f5
2 changed files with 4 additions and 8 deletions

View File

@ -528,9 +528,9 @@ abstract class FacetFieldProcessor extends FacetProcessor<FacetField> {
}
protected SimpleOrderedMap<Object> refineFacets() throws IOException {
List leaves = asList(fcontext.facetInfo.get("_l"));
List<List> skip = asList(fcontext.facetInfo.get("_s"));
List<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<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<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.

View File

@ -366,13 +366,9 @@ public abstract class FacetProcessor<FacetRequestT extends FacetRequest> {
}
}
// 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<Object> bucket, Query q, DocSet result, boolean skip, Map<String,Object> 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;