Size of Index in Elastic Search

Hi ,

Is there any way to know the size of index programmatically .Right now I am trying "http://localhost:9200/_cat/indices?h=index,store.size" which give size upto one decimal (For eg 2.6 for both 2.60 and 2.66). Kindly suggest some points.

Thanks,
Rajeev

The indices stats API provides a lot of detailed information about indices.

I tried "http://rajeevpc:9200/networkteamindex2/_stats/store" but didn't helped out. Can you help me with the exact URL.

That works for me. What error are you getting? What version of Elasticsearch are you using?

http://rajeevpc:9200/networkteamindex2/_stats/store gives this

{"_shards":{"total":10,"successful":5,"failed":0},"_all":{"primaries":{"store":{"size_in_bytes":650,"throttle_time_in_millis":0}},"total":{"store":{"size_in_bytes":650,"throttle_time_in_millis":0}}},"indices":{"networkteamindex2":{"primaries":{"store":{"size_in_bytes":650,"throttle_time_in_millis":0}},"total":{"store":{"size_in_bytes":650,"throttle_time_in_millis":0}}}}}

But I was expecting something like the output of
http://localhost:9200/_cat/indices?h=index,store.size
in form of
myindex 650b
.kibana 62.9kb
with decimal upto 2 digit .so that I can parse it easily .

I am currently using ES2.1.1