get-mapping.asciidoc 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  1. [[indices-get-mapping]]
  2. === Get mapping API
  3. ++++
  4. <titleabbrev>Get mapping</titleabbrev>
  5. ++++
  6. Retrieves <<mapping,mapping definitions>> for indices in a cluster.
  7. [source,console]
  8. --------------------------------------------------
  9. GET /twitter/_mapping
  10. --------------------------------------------------
  11. // TEST[setup:twitter]
  12. [[get-mapping-api-request]]
  13. ==== {api-request-title}
  14. `GET /_mapping`
  15. `GET /<index>/_mapping`
  16. [[get-mapping-api-path-params]]
  17. ==== {api-path-parms-title}
  18. include::{docdir}/rest-api/common-parms.asciidoc[tag=index]
  19. [[get-mapping-api-query-params]]
  20. ==== {api-query-parms-title}
  21. include::{docdir}/rest-api/common-parms.asciidoc[tag=allow-no-indices]
  22. include::{docdir}/rest-api/common-parms.asciidoc[tag=expand-wildcards]
  23. +
  24. Defaults to `open`.
  25. include::{docdir}/rest-api/common-parms.asciidoc[tag=index-ignore-unavailable]
  26. include::{docdir}/rest-api/common-parms.asciidoc[tag=local]
  27. include::{docdir}/rest-api/common-parms.asciidoc[tag=master-timeout]
  28. [[get-mapping-api-example]]
  29. ==== {api-examples-title}
  30. [[get-mapping-api-multi-ex]]
  31. ===== Multiple indices
  32. The get mapping API can be used to get more than one index with a
  33. single call. General usage of the API follows the following syntax:
  34. `host:port/{index}/_mapping` where `{index}` can accept a comma-separated
  35. list of names. To get mappings for all indices you can use `_all` for `{index}`.
  36. The following are some examples:
  37. [source,console]
  38. --------------------------------------------------
  39. GET /twitter,kimchy/_mapping
  40. --------------------------------------------------
  41. // TEST[setup:twitter]
  42. // TEST[s/^/PUT kimchy\nPUT book\n/]
  43. If you want to get mappings of all indices and types then the following
  44. two examples are equivalent:
  45. [source,console]
  46. --------------------------------------------------
  47. GET /_all/_mapping
  48. GET /_mapping
  49. --------------------------------------------------
  50. // TEST[setup:twitter]