欧美bbbwbbbw肥妇,免费乱码人妻系列日韩,一级黄片

python3實(shí)現(xiàn)elasticsearch批量更新數(shù)據(jù)

 更新時(shí)間:2019年12月03日 15:21:37   作者:拓寬視野  
今天小編就為大家分享一篇python3實(shí)現(xiàn)elasticsearch批量更新數(shù)據(jù),具有很好的參考價(jià)值,希望對大家有所幫助。一起跟隨小編過來看看吧

廢話不多說,直接上代碼!

updateBody = {
    "query":{
      "range":{
       "write_date": {
        "gte": "2019-01-15 12:30:17",
        "lte": "now"
       }
       }
    },
  "script": {
    "inline": "ctx._source.index = params.index",
    "params": {
      "index": 211
    },
    "lang":"painless"
 
  }
}
es_client.update_by_query(index="log_index",doc_type='log_index',body=updateBody)

提醒:批量更新可以針對id進(jìn)行更新

注意:painless 是es專門為更新設(shè)置的語言

以上這篇python3實(shí)現(xiàn)elasticsearch批量更新數(shù)據(jù)就是小編分享給大家的全部內(nèi)容了,希望能給大家一個(gè)參考,也希望大家多多支持腳本之家。

相關(guān)文章

最新評論