# Delete file from index with \_delete\_by\_query empties the index

**URL:** <https://discuss.elastic.co/t/delete-file-from-index-with-delete-by-query-empties-the-index/217382>\
**Category:** Elasticsearch\
**Created:** [January 31, 2020, 1:39pm UTC](https://discuss.elastic.co/t/delete-file-from-index-with-delete-by-query-empties-the-index/217382 "2020-01-31T13:39:50Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)\
**Post date:** [January 31, 2020, 1:56pm UTC](https://discuss.elastic.co/t/delete-file-from-index-with-delete-by-query-empties-the-index/217382/2 "2020-01-31T13:56:32Z")

</div>

It depends on the analyzer, mapping how you exactly run it, if by mistake you put a blank line between the POST line and the json body.

Could you provide a full recreation script as described in [About the Elasticsearch category](https://discuss.elastic.co/t/about-the-elasticsearch-category/21). It will help to better understand what you are doing. Please, try to keep the example as simple as possible.

A full reproduction script will help readers to understand, reproduce and if needed fix your problem. It will also most likely help to get a faster answer.

---

_[View the full topic](https://discuss.elastic.co/t/delete-file-from-index-with-delete-by-query-empties-the-index/217382)._
