我想列出 ElasticSearch 服务器上存在的所有索引。我试过这个:
curl -XGET localhost:9200/
但它只是给了我这个:
{
"ok" : true,
"status" : 200,
"name" : "El Aguila",
"version" : {
"number" : "0.19.3",
"snapshot_build" : false
},
"tagline" : "You Know, for Search"
}
我想要一个所有索引的列表..
最佳答案
要获得集群中所有索引的简明列表,请调用
curl http://localhost:9200/_aliases
这将为您提供一个索引列表及其别名。
如果你想要 pretty-print ,添加pretty=true
:
curl http://localhost:9200/_aliases?pretty=true
如果您的索引名为 old_deuteronomy
和 mungojerrie
,结果将如下所示:
{
"old_deuteronomy" : {
"aliases" : { }
},
"mungojerrie" : {
"aliases" : {
"rumpleteazer" : { },
"that_horrible_cat" : { }
}
}
}
关于curl - 列出 ElasticSearch 服务器上的所有索引?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17426521/