I have two shards. One of them has 46 documents other one has 42.  My
default core name is collection1.

When I select a node from first shard I see that:

Last Modified:about a minute ago
Num Docs:42
Max Doc:42
Deleted Docs:0
Version:27
Segment Count:1

When I select a node from second shard I see that:

Last Modified:2 minutes ago
Num Docs:46
Max Doc:46
Deleted Docs:0
Version:11
Segment Count:1

I want to see total number of documents at my cloud. I have written that
lines of codes:

public int getMaxDocs(CloudSolrServer solrServer){
     NamedList<Object> namedList = null;
     try {
           namedList = solrServer.request(new LukeRequest());
      } catch (SolrServerException e) {
           e.printStackTrace();
      } catch (IOException e) {
          e.printStackTrace();
     }
    return (int) ((NamedList<Object>)
namedList.get("index")).get("numDocs");
}

However I get 46 as result. I think that CloudSolrServer load balances
request and hits seconds shard. However how can I get distributed cluster
statistics? On the other hand isn't it logically wrong letting people to
use CloudSolrServer and LukeRequest together?

Reply via email to