diff --git a/solr/core/src/java/org/apache/solr/handler/component/TermsComponent.java b/solr/core/src/java/org/apache/solr/handler/component/TermsComponent.java index 28649db37f6..daf5b5b852e 100644 --- a/solr/core/src/java/org/apache/solr/handler/component/TermsComponent.java +++ b/solr/core/src/java/org/apache/solr/handler/component/TermsComponent.java @@ -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 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 stats = (NamedList)srsp.getSolrResponse().getResponse().get("stats"); + NamedList stats = (NamedList)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 stats = new SimpleOrderedMap(); stats.add("numDocs", Long.valueOf(ti.numDocs)); - rb.rsp.add("stats", stats); + rb.rsp.add("indexstats", stats); } rb._termsHelper = null; } diff --git a/solr/core/src/test/org/apache/solr/handler/component/TermsComponentTest.java b/solr/core/src/test/org/apache/solr/handler/component/TermsComponentTest.java index 473b7275102..0974524fad0 100644 --- a/solr/core/src/test/org/apache/solr/handler/component/TermsComponentTest.java +++ b/solr/core/src/test/org/apache/solr/handler/component/TermsComponentTest.java @@ -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']" ); } diff --git a/solr/solrj/src/java/org/apache/solr/client/solrj/io/stream/ScoreNodesStream.java b/solr/solrj/src/java/org/apache/solr/client/solrj/io/stream/ScoreNodesStream.java index f2aa0704fa8..0d305fdbff8 100644 --- a/solr/solrj/src/java/org/apache/solr/client/solrj/io/stream/ScoreNodesStream.java +++ b/solr/solrj/src/java/org/apache/solr/client/solrj/io/stream/ScoreNodesStream.java @@ -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 stats = (NamedList)response.get("stats"); + NamedList stats = (NamedList)response.get("indexstats"); long numDocs = stats.get("numDocs").longValue(); NamedList> fields = (NamedList>)response.get("terms");