Unfortunately this is not a simple issue to fix. someList.indexOf is based on the equivalent Java method which takes an Object and does comparisons based on that. So somewhere in the chain the users field is being parsed as both Integer and Long values (probably due to the values being unknown at the time of parsing, so anything smaller than Integer.MAX_VALUE becomes an Integer and anything greater becomes a Long.
As a workaround for now one thing to try could be the following:
Painless does not have generics, so to it, you only have List (of Object). In java, if you call Long.equals with an Integer, it will always return false (boxed types do not do promotions when comparing).
Arrays aren't a real type, they are a form that gets parsed into fields, whether they are sub fields (eg passing json objects) or concrete values in the array. As with all of a document passed to elasticsearch, it must be in json, so the limitation is whatever data types json has. See https://www.elastic.co/guide/en/elasticsearch/reference/current/array.html.
Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant
logo are trademarks of the
Apache Software Foundation
in the United States and/or other countries.