我想在elasticsearch 1.3.5中使用更新API。我有以下文件我試圖更新:elasticsearch更新API - 腳本不更改索引文件
{
"_index": "geocode",
"_type": "google",
"_id": "kolb dfsafa 303 46546456 z ",
"_version": 8,
"_score": 1,
"_source": {
"results": [
{"formatted_address": "kolb 303, 46546456 dfsafa-dfsafa-d",
"geometry": {
"location": {
"lat": 35.0360533,
"lng": 14.5632209
},
"location_type": "ROOFTOP"
},
"types": [
"street_address"
]
}
],
"status": "OK"
}
}
我有以下腳本:
POST /geocode/google/kolb%20dfsafa%20303%2046546456%20z%20/_update
{
"script":"ctx._source.results.geometry.location.lat==latitude",
"lang": "groovy",
"params":{
"latitude" : 0.0
}
}
我哪裏想更新緯度位置爲0.0。 Api調用成功完成(版本增加等),但沒有更新。
{
"_index": "geocode",
"_type": "google",
"_id": "kolb dfsafa 303 46546456 z ",
"_version": 9
}
任何提示在哪裏看?
哥們,改變==爲=。腳本應該是「ctx._source.results.geometry.location.lat =緯度」 – 2015-03-02 18:31:26
@vineeth老兄,我試過既沒有賦值也沒有加+ +沒有工作,所以這就是發佈在SO – jaksky 2015-03-02 18:35:27