# How to delete multiple documents from your index

**URL:** <https://discuss.elastic.co/t/how-to-delete-multiple-documents-from-your-index/148444>\
**Category:** Kibana\
**Created:** [September 13, 2018, 12:09pm UTC](https://discuss.elastic.co/t/how-to-delete-multiple-documents-from-your-index/148444 "2018-09-13T12:09:30Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![martb](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/martb/32/78185_2.png) [@martb](https://discuss.elastic.co/u/martb)\
**Post date:** [September 13, 2018, 12:09pm UTC](https://discuss.elastic.co/t/how-to-delete-multiple-documents-from-your-index/148444/1 "2018-09-13T12:09:30Z")

</div>

Hi,

Using the example below how do I delete all documents within an index that match the actype field i.e all REF-3?

{  
"\_index": "index-names-2018.08.27",  
"\_type": "doc",  
"\_id": "XOod0mUBf6rT7tCrMDeP",  
"\_version": 1,  
"\_score": null,  
"\_source": {  
"alertid": 6860,  
"@version": "1",  
"description": "description heret",  
"@timestamp": "2018-08-27T07:44:14.000Z",  
"commentary": "Commentary",  
"actype": "REF-3",

Thanks in advance

Martin

---

<div class="post-metadata">

**Author:** ![jbudz](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jbudz/32/45922_2.png) [@jbudz](https://discuss.elastic.co/u/jbudz)\
**Post date:** [September 13, 2018, 3:11pm UTC](https://discuss.elastic.co/t/how-to-delete-multiple-documents-from-your-index/148444/2 "2018-09-13T15:11:04Z")

</div>

You're looking for the delete\_by\_query api, [https://www.elastic.co/guide/en/elasticsearch/reference/current/docs-delete-by-query.html](https://www.elastic.co/guide/en/elasticsearch/reference/current/docs-delete-by-query.html). I'd give the query a run first before deleting to make sure verything looks okay 🙂

```auto
curl -X POST "localhost:9200/index-names-2018.08.27/_delete_by_query" -H 'Content-Type: application/json' -d'
{
  "query": { 
    "match": {
      "actype": "REF-3"
    }
  }
}
'

```

---

<div class="post-metadata">

**Author:** ![martb](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/martb/32/78185_2.png) [@martb](https://discuss.elastic.co/u/martb)\
**Post date:** [September 14, 2018, 9:48am UTC](https://discuss.elastic.co/t/how-to-delete-multiple-documents-from-your-index/148444/3 "2018-09-14T09:48:49Z")

</div>

Hi,

This was exactly what I've been looking for. Many thanks

---

<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:** [October 12, 2018, 9:48am UTC](https://discuss.elastic.co/t/how-to-delete-multiple-documents-from-your-index/148444/4 "2018-10-12T09:48:50Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
