-
Book Overview & Buying
-
Table Of Contents
-
Feedback & Rating

ElasticSearch Cookbook
By :

In the previous chapter we saw how to delete a document. Deleting a document is very fast but we need to know the document ID.
ElasticSearch provides a call to delete all the documents that match a query.
You need a working ElasticSearch cluster and an index populated with the script available in online code.
For executing a delete by query, we need to perform the following steps:
From command line, we need to execute the following query:
curl -XDELETE 'http://127.0.0.1:9200/test-index/test-type/_query' -d '{"match_all":{}}'
The result returned by ElasticSearch, if everything is all right, should be as follows:
{ "ok" : true, "_indices" : { "test-index" : { "_shards" : { "total" : 5, "successful" : 5, "failed" : 0 } } } }
The result is composed by the ok
result (a Boolean type) and the shards status at the time of the delete by query.
The query is interpreted as it is done for searching...
Change the font size
Change margin width
Change background colour