get-mapping.asciidoc 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  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::{es-repo-dir}/rest-api/common-parms.asciidoc[tag=index]
  19. [[get-mapping-api-query-params]]
  20. ==== {api-query-parms-title}
  21. include::{es-repo-dir}/rest-api/common-parms.asciidoc[tag=allow-no-indices]
  22. +
  23. Defaults to `true`.
  24. include::{es-repo-dir}/rest-api/common-parms.asciidoc[tag=expand-wildcards]
  25. +
  26. Defaults to `open`.
  27. include::{es-repo-dir}/rest-api/common-parms.asciidoc[tag=index-ignore-unavailable]
  28. include::{es-repo-dir}/rest-api/common-parms.asciidoc[tag=local]
  29. include::{es-repo-dir}/rest-api/common-parms.asciidoc[tag=master-timeout]
  30. [[get-mapping-api-example]]
  31. ==== {api-examples-title}
  32. [[get-mapping-api-multi-ex]]
  33. ===== Multiple indices
  34. The get mapping API can be used to get more than one index with a
  35. single call. General usage of the API follows the following syntax:
  36. `host:port/{index}/_mapping` where `{index}` can accept a comma-separated
  37. list of names. To get mappings for all indices you can use `_all` for `{index}`.
  38. The following are some examples:
  39. [source,console]
  40. --------------------------------------------------
  41. GET /twitter,kimchy/_mapping
  42. --------------------------------------------------
  43. // TEST[setup:twitter]
  44. // TEST[s/^/PUT kimchy\nPUT book\n/]
  45. If you want to get mappings of all indices and types then the following
  46. two examples are equivalent:
  47. [source,console]
  48. --------------------------------------------------
  49. GET /_all/_mapping
  50. GET /_mapping
  51. --------------------------------------------------
  52. // TEST[setup:twitter]