You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucene.apache.org by sh...@apache.org on 2017/03/23 14:41:18 UTC
[35/36] lucene-solr:feature/autoscaling: SOLR-7452: facet refinement
- don't generate domain if skipping bucket
SOLR-7452: facet refinement - don't generate domain if skipping bucket
Project: http://git-wip-us.apache.org/repos/asf/lucene-solr/repo
Commit: http://git-wip-us.apache.org/repos/asf/lucene-solr/commit/384c40ab
Tree: http://git-wip-us.apache.org/repos/asf/lucene-solr/tree/384c40ab
Diff: http://git-wip-us.apache.org/repos/asf/lucene-solr/diff/384c40ab
Branch: refs/heads/feature/autoscaling
Commit: 384c40abc36414a1f360f87b48aa510a4f6a60d4
Parents: f71f47c
Author: yonik <yo...@apache.org>
Authored: Wed Mar 22 19:53:50 2017 -0400
Committer: Shalin Shekhar Mangar <sh...@apache.org>
Committed: Thu Mar 23 20:10:13 2017 +0530
----------------------------------------------------------------------
.../java/org/apache/solr/search/facet/FacetFieldProcessor.java | 6 +++---
.../src/java/org/apache/solr/search/facet/FacetProcessor.java | 6 +-----
2 files changed, 4 insertions(+), 8 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/384c40ab/solr/core/src/java/org/apache/solr/search/facet/FacetFieldProcessor.java
----------------------------------------------------------------------
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 1ba252e..e8b234d 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<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.
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/384c40ab/solr/core/src/java/org/apache/solr/search/facet/FacetProcessor.java
----------------------------------------------------------------------
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 cf4d0fe..9f05d8e 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<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;