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

This commit is contained in:
Alexandre Rafalovitch 2018-07-29 12:02:07 -04:00
parent 179c8f9b48
commit e264d03920
2 changed files with 12 additions and 6 deletions

View File

@ -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.

View File

@ -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<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<>();