1
0

get-settings.asciidoc 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. [[indices-get-settings]]
  2. == Get Settings
  3. The get settings API allows to retrieve settings of index/indices:
  4. [source,js]
  5. --------------------------------------------------
  6. $ curl -XGET 'http://localhost:9200/twitter/_settings'
  7. --------------------------------------------------
  8. [float]
  9. === Multiple Indices and Types
  10. The get settings API can be used to get settings for more than one index
  11. with a single call. General usage of the API follows the
  12. following syntax: `host:port/{index}/_settings` where
  13. `{index}` can stand for comma-separated list of index names and aliases. To
  14. get settings for all indices you can use `_all` for `{index}`.
  15. Wildcard expressions are also supported. The following are some examples:
  16. [source,js]
  17. --------------------------------------------------
  18. curl -XGET 'http://localhost:9200/twitter,kimchy/_settings'
  19. curl -XGET 'http://localhost:9200/_all/_settings'
  20. curl -XGET 'http://localhost:9200/2013-*/_settings'
  21. --------------------------------------------------
  22. [float]
  23. === Prefix option
  24. There is also support for a `prefix` query string option
  25. that allows to include only settings matches the specified prefix.
  26. [source,js]
  27. --------------------------------------------------
  28. curl -XGET 'http://localhost:9200/my-index/_settings?prefix=index.'
  29. curl -XGET 'http://localhost:9200/_all/_settings?prefix=index.routing.allocation.'
  30. curl -XGET 'http://localhost:9200/2013-*/_settings?name=index.merge.*'
  31. curl -XGET 'http://localhost:9200/2013-*/_settings/index.merge.*'
  32. --------------------------------------------------
  33. The first example returns all index settings the start with `index.` in the index `my-index`,
  34. the second example gets all index settings that start with `index.routing.allocation.` for
  35. all indices, lastly the third example returns all index settings that start with `index.merge.`
  36. in indices that start with `2013-`.