SOLR-5492: Return the replica that actually served the query in shards.info response

git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1545662 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Shalin Shekhar Mangar 2013-11-26 14:05:12 +00:00
parent 9db2e666e2
commit b1a7190dbb
2 changed files with 7 additions and 0 deletions

View File

@ -103,6 +103,9 @@ New Features
This is intended to eventually replace the Suggester support through the
SpellCheckComponent. (Areek Zillur, Varun Thacker via shalin)
* SOLR-5492: Return the replica that actually served the query in shards.info
response. (shalin)
Bug Fixes
----------------------

View File

@ -813,11 +813,15 @@ public class QueryComponent extends SearchComponent
StringWriter trace = new StringWriter();
t.printStackTrace(new PrintWriter(trace));
nl.add("trace", trace.toString() );
if (srsp.getShardAddress() != null) {
nl.add("shardAddress", srsp.getShardAddress());
}
}
else {
docs = (SolrDocumentList)srsp.getSolrResponse().getResponse().get("response");
nl.add("numFound", docs.getNumFound());
nl.add("maxScore", docs.getMaxScore());
nl.add("shardAddress", srsp.getShardAddress());
}
if(srsp.getSolrResponse()!=null) {
nl.add("time", srsp.getSolrResponse().getElapsedTime());