0

I am trying to delete documents from elastic search which have certain criteria to filter from the index using deleteQueryBuilder.

Ian Campbell
  • 23,484
  • 14
  • 36
  • 57
sweety
  • 23
  • 8

3 Answers3

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
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