Hi,
I'm facing issue while updating array field
{ "error": {
"root_cause": [
{
"type": "remote_transport_exception",
"reason": "[3BcGP3Y][127.0.0.1:9300][indices:data/write/update[s]]"
}
],
"type": "illegal_argument_exception",
"reason": "failed to execute script",
"caused_by": {
"type": "script_exception",
"reason": "runtime error",
"caused_by": {
"type": "class_cast_exception",
"reason": "Cannot apply [+] operation to types [java.util.ArrayList] and [java.util.ArrayList]."
},
"script_stack": [
"ctx._source.stone_ids += params.ids",
" ^---- HERE"
],
"script": "ctx._source.stone_ids += params.ids",
"lang": "painless"
}}, "status": 400 }
while trying following update operation,
> POST /search_history/stone/2/_update
> {
> "script" : {
> "inline": "ctx._source.stone__ids += params.ids",
> "lang": "painless",
> "params" : {
> "ids" : [4,5]
> }
> },
> "upsert" : {
> "stone_ids":[4,5]
> }
> }
can anyone help me in this?