# \_meta 元字段

| \_meta | 特定应用的元数据。 |
| ------ | --------- |

## \_meta field

每个**mappingtype**（映射类型）都可以有与之相关联的自定义元数据。

这些数据完全不用于**Elasticsearch**，但可用于存储应用程序特定的元数据，例如文档所属的类 :

```
curl -XPUT 'localhost:9200/my_index?pretty' -H 'Content-Type: application/json' -d'
{
  "mappings": {
    "user": {
      "_meta": {
        "class": "MyApp::User",
        "version": {
          "min": "1.0",
          "max": "1.3"
        }
      }
    }
  }
}
'
```

| 1 | 可以使用 [GET mapping](https://www.elastic.co/guide/en/elasticsearch/reference/5.3/indices-get-mapping.html) **API**来获&#x53D6;**\_meta**的信息。 |
| - | ---------------------------------------------------------------------------------------------------------------------------------------- |

&#x8BE5;**\_meta** 字段可以使用[PUT mapping](https://www.elastic.co/guide/en/elasticsearch/reference/5.3/indices-put-mapping.html) **API**在现有类型上进行更新。
