lucene-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From arafa...@apache.org
Subject lucene-solr:branch_7x: SOLR-12574: Use a common bucket for all significantTerms outputs
Date Sun, 29 Jul 2018 16:04:57 GMT
Repository: lucene-solr
Updated Branches:
  refs/heads/branch_7x 3c3137728 -> c0b78f74e


SOLR-12574: Use a common bucket for all significantTerms outputs


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

Branch: refs/heads/branch_7x
Commit: c0b78f74e5cabb2a1aee2012aa55229a9780b86d
Parents: 3c31377
Author: Alexandre Rafalovitch <arafalov@apache.org>
Authored: Sun Jul 29 12:04:42 2018 -0400
Committer: Alexandre Rafalovitch <arafalov@apache.org>
Committed: Sun Jul 29 12:04:42 2018 -0400

----------------------------------------------------------------------
 solr/CHANGES.txt                                    |  2 ++
 .../solr/search/SignificantTermsQParserPlugin.java  | 16 ++++++++++------
 2 files changed, 12 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/c0b78f74/solr/CHANGES.txt
----------------------------------------------------------------------
diff --git a/solr/CHANGES.txt b/solr/CHANGES.txt
index f0405c0..7d7ee97 100644
--- a/solr/CHANGES.txt
+++ b/solr/CHANGES.txt
@@ -193,6 +193,8 @@ Other Changes
 
 * SOLR-12454: Tweak Overseer leadership transition related logging for easier troubleshooting.
(Christine Poerschke)
 
+* SOLR-12574: Put under a common "significantTerms" bucket all output by SignificantTerms
Query Parser (Alexandre Rafalovitch)
+
 ==================  7.4.0 ==================
 
 Consult the LUCENE_CHANGES.txt file for additional, low level, changes in this release.

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/c0b78f74/solr/core/src/java/org/apache/solr/search/SignificantTermsQParserPlugin.java
----------------------------------------------------------------------
diff --git a/solr/core/src/java/org/apache/solr/search/SignificantTermsQParserPlugin.java
b/solr/core/src/java/org/apache/solr/search/SignificantTermsQParserPlugin.java
index e781329..e484470 100644
--- a/solr/core/src/java/org/apache/solr/search/SignificantTermsQParserPlugin.java
+++ b/solr/core/src/java/org/apache/solr/search/SignificantTermsQParserPlugin.java
@@ -20,6 +20,7 @@ package org.apache.solr.search;
 
 import java.io.IOException;
 import java.util.ArrayList;
+import java.util.LinkedHashMap;
 import java.util.List;
 import java.util.TreeSet;
 
@@ -144,12 +145,15 @@ public class SignificantTermsQParserPlugin extends QParserPlugin {
       NamedList<Integer> allFreq = new NamedList();
       NamedList<Integer> allQueryFreq = new NamedList();
 
-      rb.rsp.add("numDocs", numDocs);
-      rb.rsp.add("resultCount", count);
-      rb.rsp.add("sterms", outTerms);
-      rb.rsp.add("scores", scores);
-      rb.rsp.add("docFreq", outFreq);
-      rb.rsp.add("queryDocFreq", outQueryFreq);
+      LinkedHashMap<String, Object> response = new LinkedHashMap<>();
+
+      rb.rsp.add("significantTerms", response);
+
+      response.put("numDocs", numDocs);
+      response.put("sterms", outTerms);
+      response.put("scores", scores);
+      response.put("docFreq", outFreq);
+      response.put("queryDocFreq", outQueryFreq);
 
       //TODO: Use a priority queue
       TreeSet<TermWithScore> topTerms = new TreeSet<>();


Mime
View raw message