I am trying to run update by query on my elasticsearch index using the method provided in this answer. This is the query that I've been trying to run:
curl -XPOST 'localhost:9200/my_index/_update_by_query' -d '
{
"query":{
"match":{
"latest_uuid":"d56ffe2095f511e6bcdd0acbdf0298e3"
}
},
"script" : "ctx._source.is_in_stock = \"false\";"
}'
But I keep getting the following error:
{
"error": {
"root_cause": [
{
"type": "class_cast_exception",
"reason": "java.lang.String cannot be cast to java.util.Map"
}
],
"type": "class_cast_exception",
"reason": "java.lang.String cannot be cast to java.util.Map"
},
"status": 500
}
What am I doing wrong here?