I am currently using Elastic search 5.2 and trying to perform upsert operation using the following rest api:
http://ip:9200/indexname/typename/id/_update
Json Payload:
{ "script" : { "inline": "ctx._source.size +=params.size", "lang": "painless", "params" :{ "size" : 14889114000 } }, "upsert" : { "size" : 1488911400 }
}
This api does the following things:
1.) If the index is not found in the elastic search then creates an index with the json provided inside the upsert field.
2.) If the index exist then it performs the partial update by running the painless script provided in the document.
Issue:
I have created the elastic search index mapping for counter as long.
This update works fine until the counter value is within the integer range.(i.e)2,147,483,647
Beyond this value, it overflows and becomes the negative value which in case the expected value it positive long value(as the corresponding index map is long). Is there a way to solve this int overflow issue while using painless script?