I am not too familiar with ES, so perhaps I am making some mistakes.
I have an index users
with the following mapping.
{
"mappings":{
"dynamic":false,
"properties":{
"id":{
"type":"keyword"
},
"userId":{
"type":"text"
},
"total":{
"type":"float"
},
"count":{
"type":"float"
},
"earnings":{
"properties":{
"potential":{
"properties":{
"pending":{
"type":"float"
},
"finished":{
"type":"float"
}
}
},
"completed":{
"properties":{
"pending":{
"type":"float"
},
"paid":{
"type":"float"
}
}
}
}
}
}
}
}
I would like to update the nested fields such as earnings.potential.pending using Update API. I have a script similar to below using Update API.
{
"script" : {
"source": "ctx._source.earnings.potential.pending += params.total",
"lang": "painless",
"params" : {
"total" : 4
}
}
}
However, I encouter illegal_argument_exception
, with the dot notations being the supposed issue as below.
"ctx._source.earnings.potential.pending += params.total",
^---- HERE'