June 2017
Beginner to intermediate
404 pages
8h 22m
English
For creating and retrieving a document, we used the POST and GET methods. For deleting an existing document, we need to use the HTTP DELETE method and pass the unique identifier of the document in the URL as shown here:
DELETE http://localhost:9200/chapter1/product/1
Let's inspect the request:
| INDEX | chapter1 |
| TYPE | product |
| IDENTIFIER | 1 |
| HTTP METHOD | DELETE |
The response from Elasticsearch is shown here:
{ "found": true, "_index": "chapter1", "_type": "product", "_id": "1", "_version": 4, "_shards": { "total": 1, "successful": 1, "failed": 0 } }
In the response, you can see that Elasticsearch was able to find the document with the unique identifier 1 and was successful in deleting the document. ...
Read now
Unlock full access