5

I have an _index: varnish_logs and _type: varnish

a field having two different values "server" : "india" and "server" : "usa"

Now I want to delete only the records which are in usa.

I tried using

$ curl -XDELETE 'http://localhost:9200/_all/_query?q=server:usa'

response: No handler found for uri [] and method [DELETE]

enter image description here and also tried to delete all the data using query

curl -XDELETE 'http://localhost:9200/varnish_logs/varnish/_query' -d ' { "query" :{ "match_all" : {} } }'

all I get response: found: "false" enter image description here

Please let me know where I'm wrong

2
  • I presume delete by query has been deprecated in versions after 1.5.3 [link] (elastic.co/guide/en/elasticsearch/reference/1.6/…) Commented Dec 9, 2015 at 17:22
  • @manishrw Thanks I don't get scroll_id concept is there any way to delete all records which match the query Commented Dec 9, 2015 at 17:50

1 Answer 1

9

Elasticsearch has removed the delete-by-query functionality. They have instead replaced it by a plugin with same name. It is slower than the previous but fixes the problem elasticsearch had previously.

This post from elasticsearch might help.

Sign up to request clarification or add additional context in comments.

1 Comment

Thanks. Now its done thanks and yes it is deleting really slow but works great.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.