# Delete\_by\_query returns empty

**URL:** https://discuss.elastic.co/t/delete-by-query-returns-empty/353294
**Category:** Elasticsearch
**Created:** [February 14, 2024, 3:41pm UTC](https://discuss.elastic.co/t/delete-by-query-returns-empty/353294 "2024-02-14T15:41:44Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![rachelyang](https://avatars.discourse-cdn.com/v4/letter/r/51bf81/32.png) [@rachelyang](https://discuss.elastic.co/u/rachelyang)
#### Post date: [February 14, 2024, 3:41pm UTC](https://discuss.elastic.co/t/delete-by-query-returns-empty/353294/1 "2024-02-14T15:41:44Z")

</div>

I try to delete the old records in my index, but the delete\_by\_query returns empty to me. I have a lot of data in the index, it should not be zero. Please help me to check where the problem is. Thank you!  
Here is my curl:

```auto
 curl -X POST -k -u ueser:changeme "https://localhost:9200/index_01/_delete_by_query?pretty" -H 'Content-Type: application/json' -d'
{
    "query": {
        "range": {
            "@timestamp": {
                "lt": "now-3d"
            }
        }
    }
}'

```

And this is the result:

```auto
{
  "took" : 1,
  "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.0,
  "throttled_until_millis" : 0,
  "failures" : []
}

```

---

<div class="post-metadata">

### Author: ![rachelyang](https://avatars.discourse-cdn.com/v4/letter/r/51bf81/32.png) [@rachelyang](https://discuss.elastic.co/u/rachelyang)
#### Post date: [February 14, 2024, 4:01pm UTC](https://discuss.elastic.co/t/delete-by-query-returns-empty/353294/2 "2024-02-14T16:01:05Z")

</div>

I found out the problem by myself.  
My mapping does not have @ before timestamp.

---

<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: [March 13, 2024, 4:02pm UTC](https://discuss.elastic.co/t/delete-by-query-returns-empty/353294/4 "2024-03-13T16:02:48Z")

</div>

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