You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucene.apache.org by ab...@apache.org on 2018/05/22 19:59:26 UTC
[49/50] [abbrv] lucene-solr:jira/solr-11779: SOLR-9480: minor cleanup
of nits found by sarowe
SOLR-9480: minor cleanup of nits found by sarowe
Project: http://git-wip-us.apache.org/repos/asf/lucene-solr/repo
Commit: http://git-wip-us.apache.org/repos/asf/lucene-solr/commit/f9091473
Tree: http://git-wip-us.apache.org/repos/asf/lucene-solr/tree/f9091473
Diff: http://git-wip-us.apache.org/repos/asf/lucene-solr/diff/f9091473
Branch: refs/heads/jira/solr-11779
Commit: f9091473e0587a3470751f705e143e5b5796714c
Parents: 5a47ed4
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:41:51 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/f9091473/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;