0

I have setup an ElasticSearch Index in Windows 7 64 Bit OS. Here are is my sample document :

{
      "_index" : "mydocdeleteindex",
      "_type" : "prod",
      "_id" : "AVceQ_DnIBf8JBhpZhxj",
      "_score" : 1.0,
      "_timestamp" : 1473681551591,
      "_source" : {
        "Name" : "My Sample DashBoards",
        "ID" : "forcheckdocdel",
        "Time" : "2016-09-02 07:14:23"
      }
    },

....

I would like to delete all the documents with "Name":"My Sample DashBoards" I executed the below cURL commands and none of it worked!

curl -XDELETE localhost:9200/mydocdeleteindex/prod/_query -d '{"query":{"_source":{"Name":"My Sample DashBoards"}}}'

curl -XDELETE localhost:9200/mydocdeleteindex/prod/_query -d '{"query":{"term":{"Name":"My Sample DashBoards"}}}'

curl -XDELETE localhost:9200/mydocdeleteindex/prod/_query?q=Name:My Sample DashBoards

curl -XDELETE localhost:9200/mydocdeleteindex/prod/_query?q="Name":"My Sample
DashBoards"

I get the below errors (in order):

1. {"found":false,"_index":"mydocdeleteindex","_type":"prod","_id":"_query","
_version":1,"_shards":{"total":2,"successful":1,"failed":0}}


2. {"found":false,"_index":"mydocdeleteindex","_type":"prod","_id":"_query","
_version":1,"_shards":{"total":2,"successful":1,"failed":0}}


3. {"found":false,"_index":"mydocdeleteindex","_type":"prod","_id":"_query","
_version":1,"_shards":{"total":2,"successful":1,"failed":0}}curl:(6) Could not resolve host: Sample curl: (6) Could not resolve host: DashBoards

4. curl: (52) Empty reply from server 

No change happens and I see all the data perfectly available! :(

4
  • Which version of Elasticsearch are you using? Commented Sep 12, 2016 at 13:10
  • 1
    This answer will probably help you: stackoverflow.com/questions/39328892/… (hint: you need to install the delete-by-query plugin) Commented Sep 12, 2016 at 13:11
  • @Val I am using ES 2.3.5 Commented Sep 12, 2016 at 13:13
  • Ok, then see my linked answer above and it will work. Commented Sep 12, 2016 at 13:17

1 Answer 1

1

Install delete_by_query plugin and try the same commands

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

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.