2014-08-12 06:42:12 -04:00
|
|
|
[[indices-get-index]]
|
|
|
|
== Get Index
|
|
|
|
|
2016-09-01 13:05:22 -04:00
|
|
|
The get index API allows to retrieve information about one or more indexes.
|
2014-08-12 06:42:12 -04:00
|
|
|
|
|
|
|
[source,js]
|
|
|
|
--------------------------------------------------
|
2016-09-01 13:05:22 -04:00
|
|
|
GET /twitter
|
2014-08-12 06:42:12 -04:00
|
|
|
--------------------------------------------------
|
2016-09-01 13:05:22 -04:00
|
|
|
// CONSOLE
|
|
|
|
// TEST[setup:twitter]
|
2014-08-12 06:42:12 -04:00
|
|
|
|
|
|
|
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.
|
2019-01-09 08:17:17 -05:00
|
|
|
|
|
|
|
[float]
|
|
|
|
=== Skipping types
|
|
|
|
|
|
|
|
Types are scheduled to be fully removed in Elasticsearch 8.0 and will not appear
|
|
|
|
in requests or responses anymore. You can opt in for this future behaviour by
|
|
|
|
setting `include_type_name=false` in the request, which will return mappings
|
|
|
|
directly under `mappings` without keying by the type name.
|
|
|
|
|
|
|
|
Here is an example:
|
|
|
|
|
|
|
|
[source,js]
|
|
|
|
--------------------------------------------------
|
|
|
|
PUT test?include_type_name=false
|
|
|
|
{
|
|
|
|
"mappings": {
|
|
|
|
"properties": {
|
|
|
|
"foo": {
|
|
|
|
"type": "keyword"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
GET test?include_type_name=false
|
|
|
|
--------------------------------------------------
|
|
|
|
// CONSOLE
|
|
|
|
|
|
|
|
which returns
|
|
|
|
|
|
|
|
[source,js]
|
|
|
|
--------------------------------------------------
|
|
|
|
{
|
|
|
|
"test": {
|
|
|
|
"aliases": {},
|
|
|
|
"mappings": {
|
|
|
|
"properties": {
|
|
|
|
"foo": {
|
|
|
|
"type": "keyword"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
|
|
|
"settings": {
|
|
|
|
"index": {
|
|
|
|
"creation_date": "1547028674905",
|
|
|
|
"number_of_shards": "1",
|
|
|
|
"number_of_replicas": "1",
|
|
|
|
"uuid": "u1YpkPqLSqGIn3kNAvY8cA",
|
|
|
|
"version": {
|
|
|
|
"created": ...
|
|
|
|
},
|
|
|
|
"provided_name": "test"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
--------------------------------------------------
|
|
|
|
// TESTRESPONSE[s/1547028674905/$body.test.settings.index.creation_date/]
|
|
|
|
// TESTRESPONSE[s/u1YpkPqLSqGIn3kNAvY8cA/$body.test.settings.index.uuid/]
|
|
|
|
// TESTRESPONSE[s/"created": \.\.\./"created": $body.test.settings.index.version.created/]
|