在ElasticSearch 5.x 中,为字段类型为nested的对象新增属性字段

使用解释

PUT index_name/type/_mapping
{
    "properties": {
        "nested类型字段名称": {
            "type": "nested",
            "properties": {
                "新增属性字段名称": {
                    "type": "integer"
                }
            }
        }
    }
}

示例

PUT user_info/user/_mapping
{
    "properties": {
        "user": {
            "type": "nested",
            "properties": {
                "name": {
                    "type": "keyword"
                }
            }
        }
    }
}
posted @ 2022-11-11 21:07  yourxiong  阅读(125)  评论(0)    收藏  举报