You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucene.apache.org by ho...@apache.org on 2018/05/22 18:00:23 UTC

lucene-solr:branch_7x: SOLR-9480: minor cleanup of nits found by sarowe

Repository: lucene-solr
Updated Branches:
  refs/heads/branch_7x c4a41c4c6 -> 4ea26fbca


SOLR-9480: minor cleanup of nits found by sarowe

(cherry picked from commit f9091473e0587a3470751f705e143e5b5796714c)


Project: http://git-wip-us.apache.org/repos/asf/lucene-solr/repo
Commit: http://git-wip-us.apache.org/repos/asf/lucene-solr/commit/4ea26fbc
Tree: http://git-wip-us.apache.org/repos/asf/lucene-solr/tree/4ea26fbc
Diff: http://git-wip-us.apache.org/repos/asf/lucene-solr/diff/4ea26fbc

Branch: refs/heads/branch_7x
Commit: 4ea26fbca2f14cb45aa38f00d821c99079939120
Parents: c4a41c4
Author: Chris Hostetter <ho...@apache.org>
Authored: Tue May 22 10:41:51 2018 -0700
Committer: Chris Hostetter <ho...@apache.org>
Committed: Tue May 22 10:42:15 2018 -0700

----------------------------------------------------------------------
 .../solr/search/facet/RelatednessAgg.java       | 20 +++++++++-----------
 1 file changed, 9 insertions(+), 11 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/4ea26fbc/solr/core/src/java/org/apache/solr/search/facet/RelatednessAgg.java
----------------------------------------------------------------------
diff --git a/solr/core/src/java/org/apache/solr/search/facet/RelatednessAgg.java b/solr/core/src/java/org/apache/solr/search/facet/RelatednessAgg.java
index 5bc1108..d5a8c74 100644
--- a/solr/core/src/java/org/apache/solr/search/facet/RelatednessAgg.java
+++ b/solr/core/src/java/org/apache/solr/search/facet/RelatednessAgg.java
@@ -137,7 +137,9 @@ public class RelatednessAgg extends AggValueSource {
       }
     }
     
-    return new SKGSlotAcc(fcontext, numSlots, fgFilters, bgQ);
+    DocSet fgSet = fcontext.searcher.getDocSet(fgFilters);
+    DocSet bgSet = fcontext.searcher.getDocSet(bgQ);
+    return new SKGSlotAcc(fcontext, numSlots, fgSet, bgSet);
   }
 
   @Override
@@ -151,15 +153,11 @@ public class RelatednessAgg extends AggValueSource {
     private final DocSet bgSet;
     private final long fgSize;
     private final long bgSize;
-    private final List<Query> fgFilters;
-    private final Query bgQ;
-    public SKGSlotAcc(FacetContext fcontext, int numSlots,
-                      List<Query> fgFilters, Query bgQ) throws IOException {
+    public SKGSlotAcc(final FacetContext fcontext, final int numSlots,
+                      final DocSet fgSet, final DocSet bgSet) throws IOException {
       super(fcontext);
-      this.fgFilters = fgFilters;
-      this.bgQ = bgQ;
-      this.fgSet = fcontext.searcher.getDocSet(fgFilters);
-      this.bgSet = fcontext.searcher.getDocSet(bgQ);
+      this.fgSet = fgSet;
+      this.bgSet = bgSet;
       // cache the set sizes for frequent re-use on every slot
       this.fgSize = fgSet.size();
       this.bgSize = bgSet.size();
@@ -174,8 +172,8 @@ public class RelatednessAgg extends AggValueSource {
       Query slotQ = slotContext.apply(slot).getSlotQuery();
       if (null == slotQ) {
         // extremeley special edge case...
-        // the only way this should be possible is if our skg() function is used as a "top level" stat
-        // w/o being nested under any facet, in which case it should be a FacetQuery w/no parent...
+        // the only way this should be possible is if our relatedness() function is used as a "top level"
+        // stat w/o being nested under any facet, in which case it should be a FacetQuery w/no parent...
         assert fcontext.processor.freq instanceof FacetQuery : fcontext.processor.freq;
         assert null == fcontext.parent;
         assert null == fcontext.filter;