# Delete operation using curl

**URL:** <https://discuss.elastic.co/t/delete-operation-using-curl/32504>\
**Category:** Elasticsearch\
**Created:** [October 19, 2015, 4:09pm UTC](https://discuss.elastic.co/t/delete-operation-using-curl/32504 "2015-10-19T16:09:30Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![krystalcode](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/krystalcode/32/4960_2.png) [@krystalcode](https://discuss.elastic.co/u/krystalcode)\
**Post date:** [October 19, 2015, 4:09pm UTC](https://discuss.elastic.co/t/delete-operation-using-curl/32504/1 "2015-10-19T16:09:30Z")

</div>

I'm running a query-based DELETE operation as described here: [https://www.elastic.co/guide/en/elasticsearch/reference/1.7/\_deleting\_documents.html](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.

---

<div class="post-metadata">

**Author:** ![krystalcode](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/krystalcode/32/4960_2.png) [@krystalcode](https://discuss.elastic.co/u/krystalcode)\
**Post date:** [October 20, 2015, 12:17pm UTC](https://discuss.elastic.co/t/delete-operation-using-curl/32504/2 "2015-10-20T12:17:15Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [July 5, 2017, 11:43pm UTC](https://discuss.elastic.co/t/delete-operation-using-curl/32504/3 "2017-07-05T23:43:52Z")

</div>


