Delete operation using curl


(Dimitris Bozelos) #1

I'm running a query-based DELETE operation as described here: https://www.elastic.co/guide/en/elasticsearch/reference/1.7/_deleting_documents.html

DELETE indexName/documentType/_query?pretty
{
  "query": {
    "filtered": {
      "query": {
        "match_all": {}
      },
      "filter": {
        "term": {
          "project": "project-name"
        }
      }
    }
  }
}

When I execute this exact snippet in Sense, it works fine and all matching documents are removed. However when I execute the CURL equivalent, nothing happens.

curl -XDELETE 'http://localhost:9200/indexName/documentType/_query?pretty' -d '{ "query": { "filtered": { "query": { "match_all": {} }, "filter": { "term": { "project": "project-name" } } } } }'

The response is the same in both cases:

{
   "_indices": {
      "unhack": {
         "_shards": {
            "total": 1,
            "successful": 1,
            "failed": 0
         }
      }
   }
}

It seems the query is successfully run but I can still see the document in Kibana. I'm wondering if anyone knows why this would happen.


(Dimitris Bozelos) #2

Issue resolved, apparently there was a typo in the index name :o)


(system) #3