Updating value of nested field with update_by_query API

Hi experts,

I am looking to run _update_by_query where i intend to update a field in nested object (commenter_types.ctype) with the value of other element in same nested object (commenter_types.commenter_type)

POST mention_usersv2/_update_by_query
{
  "script": {
    "inline": "ctx._source.commenter_types.ctype = ctx._source.commenter_types.commenter_type",
    "lang": "painless"
  },
  "query": {
    "constant_score" : {
        "filter" : {
            "exists" : { "field" : "commenter_types" }
        }
    }
  }
}

When i give in the above query - it unfortunately dont update. Can anyone guide in as if in case one want to achieve the above, how can we?

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.