I have a field that I've explicitly mapped to be of type long, but I see it rolling over to negative at the max value for a signed 32 bit integer.
My hunch is that it has something to do with the Painless script that I'm using to update it. I'm guessing that it is doing the math with 32 bit integers and then just assigning it to my long field.
The script is pretty simple, here's an example:
{"upsert": {"isi_tree_size": 289000},
"script": {
"lang": "painless", "inline": "ctx._source.isi_tree_size += params.isi_tree_size",
"params": {"isi_tree_size": 289000}}}
Could that be the problem? If so how do I make sure the field is treated as a long and not an int?
I'm using version 5.0.0-alpha5 of ElasticSearch.
I create the index with an explicit mapping for the isi_tree_size field to be long and when I query for the mapping the response appears to confirm that isi_tree_size is a long.