diff --git a/solr/CHANGES.txt b/solr/CHANGES.txt index c68c397bc21..99c23f1e1f0 100644 --- a/solr/CHANGES.txt +++ b/solr/CHANGES.txt @@ -221,6 +221,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. 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 58335f118bb..d5776a849cf 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; @@ -141,12 +142,15 @@ public class SignificantTermsQParserPlugin extends QParserPlugin { NamedList allFreq = new NamedList(); NamedList 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 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 topTerms = new TreeSet<>();