美文网首页
更新嵌套字段内容

更新嵌套字段内容

作者: butters001 | 来源:发表于2021-12-07 18:38 被阅读0次
http://ip:port/索引/_update_by_query

{
    "track_total_hits": "true",
    "query": {
        "bool": {
            "must": [
                {
                    "term": {
                        "字段A.字段B.keyword": "旧名称"
                    }
                }
            ]
        }
    },
    "script": {
        "source": "ctx._source.字段A['字段B'] = '新名称'",
        "lang": "painless"
    }
}

curl 单引号转义 \' 无法生效,\'\u0027替换即可

相关文章

网友评论

      本文标题:更新嵌套字段内容

      本文链接:https://www.haomeiwen.com/subject/dgeaxrtx.html