I am trying to update a doc using painless scripts. My document contain fields like "a4ayc/8"
(the field name contains the character /
).
Document sample:
{
"_index" : "user_profile",
"_type" : "_doc",
"_id" : "SQ9/X1iKV7DDJXJLLMAvyt",
"_score" : 1.0,
"_source" : {
"TgdAhWI" : "text",
"a4ayc/8" : 1,
"SyJ3d9Q" : true,
"qBC0wbU" : "2021-05-25T14:22:40.804Z"
}
}
Executing the following script i get an exception for the "a4ayc/8"
field:
[type=illegal_argument_exception, reason=invalid assignment: cannot assign a value to division operation [/]]
Script:
{
"script":{
"source":"ctx._source.TgdAhWI = params.param1; ctx._source.qBC0wbU = params.param2; ctx._source.a4ayc/8 = params.param3; ctx._source.SyJ3d9Q = params.param4; ",
"lang":"painless",
"params":{
"param3":1,
"param4":true,
"param1":"text",
"param2":"2021-05-25T14:22:40.804Z"
}
},
"upsert":{
"TgdAhWI":"text",
"a4ayc/8":1,
"SyJ3d9Q":true,
"qBC0wbU":"2021-05-25T14:22:40.804Z"
}
}
Is there any way to update field "a4ayc/8"
using scripts?