import { Client } from "https://deno.land/x/deno_es@v0.5.1/mod.ts";
update by query
if you want to update by query, you must set the query
param and script
param like this:
const info = await client.updateByQuery({
index: "myindex",
query: {
name: "Richard Hall",
},
script: {
source: 'ctx._source.message = "updated2"',
},
});
Or you can set the body
param yourself like:
{
query: {
match: {
name: "Richard Hall",
},
},
"script": {
"source": 'ctx._source.message = "updated"',
},
},