meta.asciidoc 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. [[mapping-field-meta]]
  2. === `meta`
  3. Metadata attached to the field. This metadata is opaque to Elasticsearch, it is
  4. only useful for multiple applications that work on the same indices to share
  5. meta information about fields such as units
  6. [source,console]
  7. ------------
  8. PUT my-index-000001
  9. {
  10. "mappings": {
  11. "properties": {
  12. "latency": {
  13. "type": "long",
  14. "meta": {
  15. "unit": "ms"
  16. }
  17. }
  18. }
  19. }
  20. }
  21. ------------
  22. // TEST
  23. NOTE: Field metadata enforces at most 5 entries, that keys have a length that
  24. is less than or equal to 20, and that values are strings whose length is less
  25. than or equal to 50.
  26. NOTE: Field metadata is updatable by submitting a mapping update. The metadata
  27. of the update will override the metadata of the existing field.
  28. NOTE: Field metadata is not supported on object or nested fields.
  29. Elastic products use the following standard metadata entries for fields. You
  30. can follow these same metadata conventions to get a better out-of-the-box
  31. experience with your data.
  32. unit::
  33. The unit associated with a numeric field: `"percent"`, `"byte"` or a
  34. <<time-units,time unit>>. By default, a field does not have a unit.
  35. Only valid for numeric fields. The convention for percents is to use
  36. value `1` to mean `100%`.
  37. metric_type::
  38. The metric type of a numeric field: `"gauge"` or `"counter"`. A gauge is a
  39. single-value measurement that can go up or down over time, such as a
  40. temperature. A counter is a single-value cumulative counter that only goes
  41. up, such as the number of requests processed by a web server, or resets to 0 (zero).
  42. By default, no metric type is associated with a field. Only valid for numeric fields.