Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

List all indexes on ElasticSearch server?

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:

{   "ok" : true,   "status" : 200,   "name" : "El Aguila",   "version" : {     "number" : "0.19.3",     "snapshot_build" : false   },   "tagline" : "You Know, for Search" } 

I want a list of all indexes..

like image 949
Eva Avatar asked Jul 02 '13 13:07

Eva


1 Answers

For a concise list of all indices in your cluster, call

curl http://localhost:9200/_aliases 

this will give you a list of indices and their aliases.

If you want it pretty-printed, add pretty=true:

curl http://localhost:9200/_aliases?pretty=true 

The result will look something like this, if your indices are called old_deuteronomy and mungojerrie:

{   "old_deuteronomy" : {     "aliases" : { }   },   "mungojerrie" : {     "aliases" : {       "rumpleteazer" : { },       "that_horrible_cat" : { }     }   } } 
like image 171
karmi Avatar answered Sep 19 '22 20:09

karmi