Introduction to Amazon Elasticsearch

   Go back to the Task List

  « 6. Delete the Data    8: Clean up »

7. Bulk Update and Delete

You learnt to create individual and bulk records creation in the earlier steps. You also learnt to update and delete individual records. You now learn how to bulk update and delete records along with create operation.

  1. Post the following message to the URL. It is creating two records with id 7 and 8. It is deleting record with id = 5. It also updating age field for the record with id = 6. Replace {ES_ENDPOINT_URL} with Elasticsearch Endpoint. It is very important to add a blank line in the end of the message.

    URL: {ES_ENDPOINT_URL}/_bulk

    { "create" : { "_index" : "organization", "_type" : "employee", "_id" : "7" } }
    { "name": "Jame Hoop", "department": "IT", "age": 31, "duration": 1 }
    { "create" : { "_index" : "organization", "_type" : "employee", "_id" : "8" } }
    { "name": "Jill Sack", "department": "Sales", "age": 32, "duration": 3 }
    { "delete" : { "_index" : "organization", "_id" : "5" } }
    { "update" : {"_id" : "6", "_index" : "organization"} }
    { "doc" : {"age" : 40} }
    
    

    `

    Amazon Elasticsearch

  2. This finishes the workshop. Follow the next step to clean-up the resources so that you don’t incur any cost post the workshop.