Painless script ambiguous remove method call

As the following script shows:

  "script": {
    "inline": "ctx._source.users.remove(params.users)",
    "params": {
      "users": 400903

ES complains about index_out_of_bounds_exception which it calls remove(int) but I need it call remove(Object), how to achieve it? Many thanks.

The Painless API is described here ( List only contains remove(int) as you have mentioned. The reasons for the way method overloading works in Painless are described here (

My suggestion would be to rewrite the script as the following:

1 Like

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.