get-mapping.asciidoc 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637
  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. curl -XGET 'http://localhost:9200/twitter/tweet/_mapping'
  8. --------------------------------------------------
  9. [float]
  10. === Multiple Indices and Types
  11. The get mapping API can be used to get more than one index or type
  12. mapping with a single call. General usage of the API follows the
  13. following syntax: `host:port/{index}/{type}/_mapping` where both
  14. `{index}` and `{type}` can accept a comma-separated list of names. To
  15. get mappings for all indices you can use `_all` for `{index}`. The
  16. following are some examples:
  17. [source,js]
  18. --------------------------------------------------
  19. curl -XGET 'http://localhost:9200/twitter,kimchy/_mapping'
  20. curl -XGET 'http://localhost:9200/_all/tweet,book/_mapping'
  21. --------------------------------------------------
  22. If you want to get mappings of all indices and types then the following
  23. two examples are equivalent:
  24. [source,js]
  25. --------------------------------------------------
  26. curl -XGET 'http://localhost:9200/_all/_mapping'
  27. curl -XGET 'http://localhost:9200/_mapping'
  28. --------------------------------------------------