Solved with the following:
update = ubq.script(source="ctx._source.object_name.field_name = params.new_ap_name; ctx._source.radio.Accesspoint_name = params.new_ap_name; ",
lang="painless",
params={ "new_ap_name": "new_field_value" }).update_from_dict({
"query": {
"bool": {
"must": [
{ "match": { "object_name.field_name": "new_field_value" } },
{ "match": { "account_name": "Filters documents of specific customer" } }
]
}
}
}).params(request_timeout=3600).params(wait_for_completion=False).params(wait_for_active_shards=1).params(refresh=True)
response = update.execute()
The old and new field values can be provided by your python script.
hope this helps