For some reason in Elasticsearch’s “painless” scripting language the += operator only works for values less than 2^32. Kinda sad given that I’m using it on a long that should support up to 2^64.
Instead, you need to use value = value + 1, which works.