Created
February 27, 2024 15:02
-
-
Save craigeddy/41051acbf4b6929b9c6129953b8160c9 to your computer and use it in GitHub Desktop.
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 subjects/_update_by_query | |
{ | |
"query": { | |
"match": { | |
"handleList.platform": "0" | |
} | |
}, | |
"script": { | |
"source": """if (ctx._source.handleList != null) { | |
for (int i=ctx._source.handleList.length-1; i>=0; i--) { | |
if (ctx._source.handleList[i]['platform'] == "0") { | |
ctx._source.handleList[i]['platform'] = "TikTok"; | |
break; | |
}}}""", | |
"lang": "painless" | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment