How do I achieve the following in Java api?
POST test/type1/1/_update
{
"script" : {
"inline": "ctx._source.tags.add(params.tag)",
"lang": "painless",
"params" : {
"tag" : "blue"
}
}
}
The current document is:
PUT test/type1/1
{
"counter" : 1,
"tags" : ["red"]
}