# Delete By Query Not Working

**URL:** <https://discuss.elastic.co/t/delete-by-query-not-working/338971>\
**Category:** Elasticsearch\
**Created:** [July 21, 2023, 10:28pm UTC](https://discuss.elastic.co/t/delete-by-query-not-working/338971 "2023-07-21T22:28:14Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![wwalker](https://avatars.discourse-cdn.com/v4/letter/w/43a26b/32.png) [@wwalker](https://discuss.elastic.co/u/wwalker)\
**Post date:** [July 21, 2023, 10:28pm UTC](https://discuss.elastic.co/t/delete-by-query-not-working/338971/1 "2023-07-21T22:28:14Z")

</div>

I have a field that frequently has the value of `:`. I'm trying to delete all of these entries using the below.

```auto
POST /index/_delete_by_query
{
  "query": {
    "match": {
        "log.message": ":"
    }
  }
}

```

Using dev tools, it seems to run successfully.

```auto
{
  "took": 0,
  "timed_out": false,
  "total": 0,
  "deleted": 0,
  "batches": 0,
  "version_conflicts": 0,
  "noops": 0,
  "retries": {
    "bulk": 0,
    "search": 0
  },
  "throttled_millis": 0,
  "requests_per_second": -1,
  "throttled_until_millis": 0,
  "failures": []
}

```

But then when I check the index, entries still exist.

![image](https://us1.discourse-cdn.com/elastic/original/3X/9/3/93c6189e6c6e4a362611774edb67d0daf8cbda05.png)

---

<div class="post-metadata">

**Author:** ![RabBit\_BR](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/rabbit_br/32/82261_2.png) [@RabBit\_BR](https://discuss.elastic.co/u/RabBit_BR)\
**Post date:** [July 21, 2023, 11:43pm UTC](https://discuss.elastic.co/t/delete-by-query-not-working/338971/2 "2023-07-21T23:43:54Z")

</div>

Hi @wwalker

Probably your text field is using the "standard" analyzer and that's why there is no token.  
Try using the keyword field:

```auto
{
  "query": {
    "match": {
        "log.message.keyword": ":"
    }
  }
}

```

---

<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:** [August 18, 2023, 11:44pm UTC](https://discuss.elastic.co/t/delete-by-query-not-working/338971/3 "2023-08-18T23:44:30Z")

</div>

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