原文地址: https://www.elastic.co/guide/en/elasticsearch/reference/7.7/mapping-field-meta.html, 原文档版权归 www.elastic.co 所有

metaedit

Metadata attached to the field. This metadata is opaque to Elasticsearch, it is only useful for multiple applications that work on the same indices to share meta information about fields such as units

PUT my_index
{
  "mappings": {
    "properties": {
      "latency": {
        "type": "long",
        "meta": {
          "unit": "ms"
        }
      }
    }
  }
}

Field metadata enforces at most 5 entries, that keys have a length that is less than or equal to 20, and that values are strings whose length is less than or equal to 50.

Field metadata is updatable by submitting a mapping update. The metadata of the update will override the metadata of the existing field.