get-mapping.asciidoc 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. [[indices-get-mapping]]
  2. == Get Mapping
  3. The get mapping API allows to retrieve mapping definitions for an index or
  4. index/type.
  5. [source,js]
  6. --------------------------------------------------
  7. GET /twitter/_mapping
  8. --------------------------------------------------
  9. // CONSOLE
  10. // TEST[setup:twitter]
  11. NOTE: Before 7.0.0, the 'mappings' definition used to include a type name. Although mappings
  12. in responses no longer contain a type name by default, you can still request the old format
  13. through the parameter include_type_name. For more details, please see <<removal-of-types>>.
  14. [float]
  15. === Multiple Indices
  16. The get mapping API can be used to get more than one index with a
  17. single call. General usage of the API follows the following syntax:
  18. `host:port/{index}/_mapping` where `{index}` can accept a comma-separated
  19. list of names. To get mappings for all indices you can use `_all` for `{index}`.
  20. The following are some examples:
  21. [source,js]
  22. --------------------------------------------------
  23. GET /twitter,kimchy/_mapping
  24. --------------------------------------------------
  25. // CONSOLE
  26. // TEST[setup:twitter]
  27. // TEST[s/^/PUT kimchy\nPUT book\n/]
  28. If you want to get mappings of all indices and types then the following
  29. two examples are equivalent:
  30. [source,js]
  31. --------------------------------------------------
  32. GET /_all/_mapping
  33. GET /_mapping
  34. --------------------------------------------------
  35. // CONSOLE
  36. // TEST[setup:twitter]