Indices count

Hi,

How can i get count of indices?
_cat/indices can list all the indices but i want count for it not list.

With aggs , I belived that's possible

Aggs count ... Terms _index

When I have a time... I will try

Good luck

Following query will works but it will count only indices with documents inside. Empty indices will not be taken into account :

GET _search
{
  "size": 0, 
  "aggs": {
    "countIndices": {
      "cardinality": {
        "field": "_index"
      }}
  }
}

Thank you. It work for me

curl -s ES_HOST:9200/_cat/indices | wc -l

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.