Get Index

edit

The get index API allows to retrieve information about one or more indexes.

GET /twitter

The above example gets the information for an index called twitter. Specifying an index, alias or wildcard expression is required.

The get index API can also be applied to more than one index, or on all indices by using _all or * as index.

Skipping types

edit

Types are being removed from Elasticsearch: in 7.0, the mappings element will no longer return the type name as a top-level key by default. You can already opt in for this behavior by setting include_type_name=false on the request.

Such calls will be rejected on indices that have multiple types as it introduces ambiguity as to which mapping should be returned. Only indices created by Elasticsearch 5.x may have multiple types.

Here is an example:

GET twitter?include_type_name=false

which returns

{
    "twitter": {
        "aliases": {},
        "mappings" : {
            "properties" : {
              "date" : {
                "type" : "date"
              },
              "likes" : {
                "type" : "long"
              },
              "message" : {
                "type" : "text",
                "fields" : {
                  "keyword" : {
                    "type" : "keyword",
                    "ignore_above" : 256
                  }
                }
              },
              "user" : {
                "type" : "keyword"
              }
            }
        },
        "settings": {
            "index": {
                "creation_date": "1547028674905",
                "number_of_shards": "1",
                "number_of_replicas": "1",
                "uuid": "u1YpkPqLSqGIn3kNAvY8cA",
                "version": {
                    "created": ...
                },
                "provided_name": "twitter"
            }
        }
    }
}