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 my-index/_update_by_query | |
{ | |
"script": { | |
// "source" after v5.6, "inline" before | |
"source": """ | |
for (item in ctx._source.nested_items) { | |
for(param in params.new_values) { | |
if (item.category == param.category) { | |
item.description = param.description; | |
} |
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
async function run() { | |
const delayMs = 1000; | |
const startedAt = Date.now(); | |
console.log("[Workshop] Starting a third-party script not so important 😃"); | |
if (document.currentScript.defer) { | |
await new Promise((resolve) => setTimeout(resolve, delayMs)); | |
} else { | |
const waitUntil = Date.now() + delayMs; |