【问题标题】:How to know the number of types in the elastic search index如何知道弹性搜索索引中的类型数
【发布时间】:2014-06-30 05:10:16
【问题描述】:

这是我的问题描述

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

【问题讨论】:

    标签: elasticsearch


    【解决方案1】:

    你可以使用get映射命令:

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

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

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

    【讨论】:

    • 这将返回整个另一个索引映射,包括所有类型。这很好。还有其他命令只知道特定类型吗?
    猜你喜欢
    • 1970-01-01
    • 2018-03-27
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2012-09-07
    • 1970-01-01
    • 1970-01-01
    • 2016-10-24
    相关资源
    最近更新 更多