4

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.

Rahul Sharma
  • 5,614
  • 10
  • 57
  • 91

3 Answers3

4

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!

MatsLindh
  • 49,529
  • 4
  • 53
  • 84
  • Thanks :) it's really helpful...query: http://localhost:9999/solr/TS/select?q=*%3A*&wt=json&shards.info=true&rows=0 – Rahul Sharma Jan 18 '16 at 23:19
0

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.

YoungHobbit
  • 13,254
  • 9
  • 50
  • 73
-2
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

YoungHobbit
  • 13,254
  • 9
  • 50
  • 73