Elasticsearch内のデータの一部の書き換えは
Update APIを使います。
ドキュメントは、
Updates with a partial documentあたりになります。
確認
書き換え対象のデータの内容です。hoge1とhoge2のキーを持っています。
$ curl -s http://localhost:9200/test_index/hoge/1 | jq
{
  "_index": "test_index",
  "_type": "hoge",
  "_id": "1",
  "_version": 3,
  "found": true,
  "_source": {
    "hoge1": "hoge1",
    "hoge2": "fuga2"
  }
}
Update APIを叩いて、hoge1の値を変更してみます。
公式ドキュメントに従い、
POSTで変更対象のidの
_updateを叩きます。
body部には、jsonでdoc配下に変更したい内容を定義して送ります。
$ curl -XPOST -H "Content-Type: application/json" http://localhost:9200/test_index/hoge/1/_update -d ' 
{
  "doc": {
    "hoge1": "mod-hoge1"
  }
}
'
書き換えたデータを取得すると、データの内容が変更されていることが確認できます。
$ curl -s http://localhost:9200/test_index/hoge/1 | jq
{
  "_index": "test_index",
  "_type": "hoge",
  "_id": "1",
  "_version": 4,
  "found": true,
  "_source": {
    "hoge1": "mod-hoge1",
    "hoge2": "fuga2"
  }
}