You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucene.apache.org by da...@apache.org on 2018/08/06 04:15:37 UTC

[04/48] lucene-solr:jira/http2: SOLR-12574: Fix the SignificantTermStream to use the new bucket format

SOLR-12574: Fix the SignificantTermStream to use the new bucket format


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

Branch: refs/heads/jira/http2
Commit: abd6b07ea98eaf24577ad8c347bb39f491276fa0
Parents: 4602e4d
Author: Alexandre Rafalovitch <ar...@apache.org>
Authored: Tue Jul 31 08:18:39 2018 -0400
Committer: Alexandre Rafalovitch <ar...@apache.org>
Committed: Tue Jul 31 08:18:39 2018 -0400

----------------------------------------------------------------------
 .../solrj/io/stream/SignificantTermsStream.java     | 16 ++++++++++------
 1 file changed, 10 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/abd6b07e/solr/solrj/src/java/org/apache/solr/client/solrj/io/stream/SignificantTermsStream.java
----------------------------------------------------------------------
diff --git a/solr/solrj/src/java/org/apache/solr/client/solrj/io/stream/SignificantTermsStream.java b/solr/solrj/src/java/org/apache/solr/client/solrj/io/stream/SignificantTermsStream.java
index 4562cd3..729ddb1 100644
--- a/solr/solrj/src/java/org/apache/solr/client/solrj/io/stream/SignificantTermsStream.java
+++ b/solr/solrj/src/java/org/apache/solr/client/solrj/io/stream/SignificantTermsStream.java
@@ -44,6 +44,7 @@ import org.apache.solr.client.solrj.io.stream.expr.StreamExpressionValue;
 import org.apache.solr.client.solrj.io.stream.expr.StreamFactory;
 import org.apache.solr.client.solrj.request.QueryRequest;
 import org.apache.solr.client.solrj.response.QueryResponse;
+import org.apache.solr.common.SolrDocumentList;
 import org.apache.solr.common.params.ModifiableSolrParams;
 import org.apache.solr.common.util.ExecutorUtil;
 import org.apache.solr.common.util.NamedList;
@@ -286,13 +287,16 @@ public class SignificantTermsStream extends TupleStream implements Expressible{
         long numDocs = 0;
         long resultCount = 0;
         for (Future<NamedList> getTopTermsCall : callShards(getShards(zkHost, collection, streamContext))) {
-          NamedList resp = getTopTermsCall.get();
+          NamedList fullResp = getTopTermsCall.get();
+          Map stResp = (Map)fullResp.get("significantTerms");
 
-          List<String> terms = (List<String>)resp.get("sterms");
-          List<Integer> docFreqs = (List<Integer>)resp.get("docFreq");
-          List<Integer> queryDocFreqs = (List<Integer>)resp.get("queryDocFreq");
-          numDocs += (Integer)resp.get("numDocs");
-          resultCount += (Integer)resp.get("resultCount");
+          List<String> terms = (List<String>)stResp.get("sterms");
+          List<Integer> docFreqs = (List<Integer>)stResp.get("docFreq");
+          List<Integer> queryDocFreqs = (List<Integer>)stResp.get("queryDocFreq");
+          numDocs += (Integer)stResp.get("numDocs");
+
+          SolrDocumentList searchResp = (SolrDocumentList) fullResp.get("response");
+          resultCount += searchResp.getNumFound();
 
           for (int i = 0; i < terms.size(); i++) {
             String term = terms.get(i);