列出ElasticSearch服务器上的所有索引? [英] list all indexes on ElasticSearch server?

查看:150
本文介绍了列出ElasticSearch服务器上的所有索引?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想列出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
}
pre>

我想要所有索引的列表。

解决方案

要获取集群中所有索引的简明列表,请调用

  curl http:// localhost:9200 / _aliases 



这将给您一个索引及其别名的列表。



如果你想要它漂亮打印,添加 pretty = 1

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

像这样,如果你的索引叫 old_deuteronomy mungojerrie

  {
old_deuteronomy:{
aliases:{}
},
mungojerrie:{
aliases:{
rumpleteazer:{},
that_horrible_cat:{}
}
}
}


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..

解决方案

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=1:

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

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" : { }
    }
  }
}

这篇关于列出ElasticSearch服务器上的所有索引?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆