I would like to list all indexes present on an ElasticSearch server. I tried this:
curl -XGET localhost:9200/
but it just gives me this:
The _stats command provides ways to customize the results by specifying the metrics wished. To get the indices the query is as follows:
GET /_stats/indices
The general format of the _stats query is:
/_stats
/_stats/{metric}
/_stats/{metric}/{indexMetric}
/{index}/_stats
/{index}/_stats/{metric}
Where the metrics are:
indices, docs, store, indexing, search, get, merge,
refresh, flush, warmer, filter_cache, id_cache,
percolate, segments, fielddata, completion
As an exercice to myself, I've written a small elasticsearch plugin providing the functionality to list elasticsearch indices without any other information. You can find it at the following url:
http://blog.iterativ.ch/2014/04/11/listindices-writing-your-first-elasticsearch-java-plugin/
https://github.com/iterativ/elasticsearch-listindices