Created
May 13, 2021 08:47
-
-
Save AviranAbady/f45975c519e2a0e5c0c1edf1a0c0b060 to your computer and use it in GitHub Desktop.
Elasticsearch update by query using params to set an object
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
POST management_users/_update_by_query | |
{ | |
"script": { | |
"source": "ctx._source.web_permissions=params.web_permissions", | |
"params": { | |
"web_permissions": { | |
"allowed_actions": [], | |
"permissions_group_name": "full_control", | |
"permissions_group_id": "f-AbVXgBawR5qZFRXLTM", | |
"permissions_group_label": "Full control" | |
} | |
} | |
}, | |
"query": { | |
"bool": { | |
"must_not": { | |
"exists": { | |
"field": "web_permissions" | |
} | |
} | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment