2017-02-14 16 views
0

Elasticsearchを動作しません。 the docelasticsearch _update_by_queryは

更新

{ 
    "took": 9, 
    "timed_out": false, 
    "total": 1, 
    "updated": 1, 
    "batches": 1, 
    "version_conflicts": 0, 
    "noops": 0, 
    "retries": 0, 
    "failures": [] 
} 

POST test-index/doc/_update_by_query?name=subramanian 
{ 
    "query": { 
    "match": { 
     "name": "sahas" 
    } 
    } 
} 

結果しかし、私は再び文書を照会するとき、その更新されません。 ここでアップデートがうまくいかない理由を突き止めてください。 私は何か愚かな行方不明ですか?

入力を歓迎します。

答えて

1

あなたのアップデートによる更新ではソースが変更されませんでした。そうするには、スクリプトを含める必要があります。

POST test-index/doc/_update_by_query 
{ 
    "query": { 
    "match": { 
     "name": "sahas" 
    } 
    }, 
    "script": { 
    "inline": "ctx._source.name = 'subramanian'" 
    } 
}