I want to get number of shards along with number of documents in each shard in solrcloud, is there any direct command to get these stats?
As of now I pull these stats from each node UI which takes very long time. I am using solcloud5.2.
I want to get number of shards along with number of documents in each shard in solrcloud, is there any direct command to get these stats?
As of now I pull these stats from each node UI which takes very long time. I am using solcloud5.2.
Solr supports adding shards.info
in the request to get numFound, score and time spent for each shard when retrieving the results.
That works for manual sharding at least, but give it a try for implicit sharding in SolrCloud as well!
I am not aware of any direct option where you can make a single query and get the document for each shard.
You can use the distrib=false
option for restricting the query from being sent to any other shard.
You can use the below query for each shard. You can automate it in shell scripts for each shard:
http://<host>:<port>/solr/<core>/select?q=*:*&distrib=false
The document count will be available in NumFound
parameter.
http://<Any Node IP in solrCloud>:port/solr/collection_name/select?q=*:*&wt=json&indent=true&shards=shard_IP:7070/solr/collection_name
you will get the document count in numFound