I am trying to delete documents from elastic search which have certain criteria to filter from the index using deleteQueryBuilder
.
Asked
Active
Viewed 1,151 times
0

Ian Campbell
- 23,484
- 14
- 36
- 57

sweety
- 23
- 8
3 Answers
0
I am not sure about deleteQueryBuilder. However, if you are able to search your record (as you mentioned, some criteria), then replace your GET/PUT/POST etc to DELETE only which will delete your filtered records.

Navin Rawat
- 3,208
- 1
- 19
- 31
0
Try this for deleting entire index.i think there is no possibility of deleting documents
1.you can delete using id
$ curl -XDELETE 'http://localhost:9200/twitter/tweet/1'
2.or delete entire index
$ curl -XDELETE 'http://localhost:9200/twitter/'

Veerendra Borra
- 1,286
- 14
- 24
-
I have to filter the documents using match query – sweety May 02 '16 at 09:57
-
match all returns all fields – Veerendra Borra May 02 '16 at 11:58
-
There is a possibility with Delete.Builder to delete only one document using the id of the document. But I would like to filter with particular field which is not Id, a normal field. – sweety May 02 '16 at 12:15
-
you can delete any document with their id. https://www.elastic.co/guide/en/elasticsearch/reference/current/docs-delete.html – Veerendra Borra May 02 '16 at 12:16
-
check it for deleting indices . https://www.elastic.co/guide/en/elasticsearch/reference/current/indices-delete-index.html – Veerendra Borra May 02 '16 at 12:17
-
I would like to filter with particular field which is not Id, a normal field. – sweety May 02 '16 at 12:17
-
I don't want to delete entire index,but a single object in it. – sweety May 02 '16 at 12:19
-
check this link https://www.elastic.co/guide/en/elasticsearch/reference/current/docs-delete.html – Veerendra Borra May 02 '16 at 12:21
-
Yes, I did that. But we have DeleteByQuery, I want to use that.which is here https://www.elastic.co/guide/en/elasticsearch/plugins/current/delete-by-query-usage.html with Jest – sweety May 02 '16 at 12:23
0
In Jest I you want to use the:
DeleteByQuery.Builder(query)
method .. the Delete builder method is for id's only

Richard Donovan
- 435
- 3
- 10