我試圖在this答案中提供的方法對我的elasticsearch索引運行update by query
。這是我一直在試圖運行查詢:通過elasticsearch中的查詢更新
curl -XPOST 'localhost:9200/my_index/_update_by_query' -d '
{
"query":{
"match":{
"latest_uuid":"d56ffe2095f511e6bcdd0acbdf0298e3"
}
},
"script" : "ctx._source.is_in_stock = \"false\";"
}'
但我不斷收到以下錯誤:
{
"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
}
什麼我錯在這裏做什麼?
嘗試「_update_by_query?is_in_stock = false」並刪除腳本行,以查看問題是否爲腳本 –