meta-field.asciidoc 769 B

123456789101112131415161718192021222324252627282930
  1. [[mapping-meta-field]]
  2. === `_meta` field
  3. A mapping type can have custom meta data associated with it. These are not
  4. used at all by Elasticsearch, but can be used to store application-specific
  5. metadata, such as the class that a document belongs to:
  6. [source,js]
  7. --------------------------------------------------
  8. PUT my_index
  9. {
  10. "mappings": {
  11. "_doc": {
  12. "_meta": { <1>
  13. "class": "MyApp::User",
  14. "version": {
  15. "min": "1.0",
  16. "max": "1.3"
  17. }
  18. }
  19. }
  20. }
  21. }
  22. --------------------------------------------------
  23. // CONSOLE
  24. <1> This `_meta` info can be retrieved with the
  25. <<indices-get-mapping,GET mapping>> API.
  26. The `_meta` field can be updated on an existing type using the
  27. <<indices-put-mapping,PUT mapping>> API.