Why does this work?
ctx._source.locations.remove(ctx._source.locations.indexOf(params.delete_location));
and not this?
ctx._source.locations.remove(params.delete_location);
I get this error:
"caused_by": {
"type": "class_cast_exception",
"reason": "class_cast_exception: null"
}
I am trying to update a field that is a list of strings using update_by_query. I validated with the Painless debug tool, Debug.explain
that params.delete_location is a string and ctx._source.locations
is an ArrayList.
Using Elasticsearch version 5.5.