Elasticsearch 新增字段

Elasticsearch 6.3版本下新增字段

如:给索引index的类型type新增字段name:

POST index/type/_mapping
{
  "properties": {
    "name":{
      "type":"keyword",
      "doc_values":false,
      "norms": false
    }
  }
}

注:也可以用PUT。

在嵌套节点下面新增字段,mapping正常写:

PUT index/type/_mapping
{
    "properties": {
        "channelTradeNo": {
            "type": "keyword",
            "norms": false,
            "doc_values": false
        },
        "orderDetails": {
            "type": "nested",
            "properties": {
                "rightsStatus": {
                    "type": "keyword",
                    "norms": false,
                    "doc_values": false
                },
                "rightsCurrTime": {
                    "type": "keyword",
                    "norms": false,
                    "doc_values": false
                },
                "rightsEndTime": {
                    "type": "keyword",
                    "norms": false,
                    "doc_values": false
                }
            }
        }
    }
}

你可能感兴趣的:(ElasticSearch)