如何知道elasticsearch索引中的类型数

时间:2014-06-30 05:10:16

标签: elasticsearch

这是我的问题描述

  • 我创建了名为 testindex
  • 的弹性搜索索引
  • curl -XPUT'localhost:8080 / testindex / type1 / id1?pretty = true'
  • 截至目前,我知道我的testindex有一种类型,即type1
  • 我还有一个名为 anotherindex 的索引,我想通过查看索引名称来了解 anotherindex 中有多少类型。
  • 怎么知道。有没有curl命令?

1 个答案:

答案 0 :(得分:0)

您可以使用get mapping命令:

curl -XGET 'http://localhost:9200/anotherindex/_mapping?pretty'

该命令将列出索引anotherindex的所有映射。

http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/indices-get-mapping.html

相关问题