SOLR-9193: fixing failing tests due to changes in TermsComponent

This commit is contained in:
jbernste 2016-07-04 22:32:51 -04:00
parent e1f51a20d7
commit 360c4da90b
3 changed files with 7 additions and 5 deletions

View File

@ -67,6 +67,8 @@ public class TermsComponent extends SearchComponent {
SolrParams params = rb.req.getParams();
if (params.getBool(TermsParams.TERMS, false)) {
rb.doTerms = true;
} else {
return;
}
// TODO: temporary... this should go in a different component.
@ -97,7 +99,7 @@ public class TermsComponent extends SearchComponent {
if(termStats) {
NamedList<Number> stats = new SimpleOrderedMap();
rb.rsp.add("stats", stats);
rb.rsp.add("indexstats", stats);
collectStats(rb.req.getSearcher(), stats);
}
@ -301,7 +303,7 @@ public class TermsComponent extends SearchComponent {
th.parse(terms);
NamedList<Number> stats = (NamedList<Number>)srsp.getSolrResponse().getResponse().get("stats");
NamedList<Number> stats = (NamedList<Number>)srsp.getSolrResponse().getResponse().get("indexstats");
if(stats != null) {
th.numDocs += stats.get("numDocs").longValue();
th.stats = true;
@ -323,7 +325,7 @@ public class TermsComponent extends SearchComponent {
if(ti.stats) {
NamedList<Number> stats = new SimpleOrderedMap();
stats.add("numDocs", Long.valueOf(ti.numDocs));
rb.rsp.add("stats", stats);
rb.rsp.add("indexstats", stats);
}
rb._termsHelper = null;
}

View File

@ -198,7 +198,7 @@ public class TermsComponentTest extends SolrTestCaseJ4 {
assertQ(req("indent", "true", "qt", "/terms", "terms", "true",
"terms.fl", "standardfilt","terms.stats", "true",
"terms.list", "spider, snake, shark, ddddd, bad")
, "//lst[@name='stats']/int[1][@name='numDocs'][.='23']"
, "//lst[@name='indexstats']/long[1][@name='numDocs'][.='23']"
);
}

View File

@ -189,7 +189,7 @@ public class ScoreNodesStream extends TupleStream implements Expressible
//Get the response from the terms component
NamedList response = client.request(request, collection);
NamedList<Number> stats = (NamedList<Number>)response.get("stats");
NamedList<Number> stats = (NamedList<Number>)response.get("indexstats");
long numDocs = stats.get("numDocs").longValue();
NamedList<NamedList<Number>> fields = (NamedList<NamedList<Number>>)response.get("terms");