This topic describes how to use Alibaba Cloud Elasticsearch (ES) to update a document.

Use the Kibana console to access Alibaba Cloud Elasticsearch, and send the following request to update a document:
  • Update a whole document:
    PUT /my_index/my_type/1? pretty
    {
      "title": "One World One Dream", 
      "tags": ["ruby"],
      "post_date":"2009-11-15T13:00:00"
    }
    If the request is successful, the following result is returned:
    {
      "_index" : "my_index",
      "_type" : "my_type",
      "_id" : "1",
      "_version" : 2,
      "result" : "updated",
      "_shards" : {
        "total" : 2,
        "successful" : 2,
        "failed" : 0
      },
      "_seq_no" : 1,
      "_primary_term" : 1
    }
  • Make partial updates to a document:
    POST /my_index/my_type/1/_update? pretty
    {
      "doc":{"title": "One World"}
    }
    If the request is successful, the following result is returned:
    {
      "_index" : "my_index",
      "_type" : "my_type",
      "_id" : "1",
      "_version" : 3,
      "result" : "updated",
      "_shards" : {
        "total" : 2,
        "successful" : 2,
        "failed" : 0
      },
      "_seq_no" : 2,
      "_primary_term" : 1
    }