es 局部更新 DSL 语句

curl -XPOST '192.168.1.47:9200/sub/_refresh'


//更新 根据条件
curl -XPOST '192.168.1.4:9200/sub/_update_by_query?pretty' -H 'Content-Type: application/json' -d'
{
   "query": {
    "term": {
      "md5": "d2b7bca41afc9e8bb873ced2e592a3f0"
    }
  },
  "script": {
    "inline":"ctx._source.advertiser = 999"
  }
}
'


curl -XPOST '192.168.1.4:9200/sub/subject_index/178913/_update?pretty' -H 'Content-Type: application/json' -d'
{
    "script" : {
        "inline":"ctx._source.advertiser = 26"
    }
}
'

你可能感兴趣的:(elasticsearch)