OpenSearch/docs/reference/indices/get-settings.asciidoc
Alexander Reelsen 349a8be4fd Consistent REST API changes for GETting data
* Made GET mappings consistent, supporting
  * /{index}/_mappings/{type}
  * /{index}/_mapping/{type}
  * /_mapping/{type}
  * Added "mappings" in the JSON response to align it with other responses
* Made GET warmers consistent, support /{index}/_warmers/{type} and /_warmer, /_warner/{name}
  as well as wildcards and _all notation
* Made GET aliases consistent, support /{index}/_aliases/{name} and /_alias, /_aliases/{name}
  as well as wildcards and _all notation
* Made GET settings consistent, added /{index}/_setting/{name}, /_settings/{name}
  as well as supportings wildcards in settings name
* Returning empty JSON instead of a 404, if a specific warmer/
  setting/alias/type is missing
* Added a ton of spec tests for all of the above
* Added a couple of more integration tests for several features

Relates #4071
2014-01-14 22:33:52 +01:00

51 lines
1.8 KiB
Plaintext

[[indices-get-settings]]
== Get Settings
The get settings API allows to retrieve settings of index/indices:
[source,js]
--------------------------------------------------
$ curl -XGET 'http://localhost:9200/twitter/_settings'
--------------------------------------------------
[float]
=== Multiple Indices and Types
The get settings API can be used to get settings for more than one index
with a single call. General usage of the API follows the
following syntax: `host:port/{index}/_settings` where
`{index}` can stand for comma-separated list of index names and aliases. To
get settings for all indices you can use `_all` for `{index}`.
Wildcard expressions are also supported. The following are some examples:
[source,js]
--------------------------------------------------
curl -XGET 'http://localhost:9200/twitter,kimchy/_settings'
curl -XGET 'http://localhost:9200/_all/_settings'
curl -XGET 'http://localhost:9200/2013-*/_settings'
--------------------------------------------------
[float]
=== Prefix option
There is also support for a `prefix` query string option
that allows to include only settings matches the specified prefix.
[source,js]
--------------------------------------------------
curl -XGET 'http://localhost:9200/my-index/_settings?prefix=index.'
curl -XGET 'http://localhost:9200/_all/_settings?prefix=index.routing.allocation.'
curl -XGET 'http://localhost:9200/2013-*/_settings?name=index.merge.*'
curl -XGET 'http://localhost:9200/2013-*/_settings/index.merge.*'
--------------------------------------------------
The first example returns all index settings the start with `index.` in the index `my-index`,
the second example gets all index settings that start with `index.routing.allocation.` for
all indices, lastly the third example returns all index settings that start with `index.merge.`
in indices that start with `2013-`.