# Unable to delete child documents by query that uses "has parent" (ES 1.4.1)

**URL:** <https://discuss.elastic.co/t/unable-to-delete-child-documents-by-query-that-uses-has-parent-es-1-4-1/28276>\
**Category:** Elasticsearch\
**Created:** [August 29, 2015, 6:24am UTC](https://discuss.elastic.co/t/unable-to-delete-child-documents-by-query-that-uses-has-parent-es-1-4-1/28276 "2015-08-29T06:24:05Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Ron\_Sher](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ron_sher/32/4472_2.png) [@Ron\_Sher](https://discuss.elastic.co/u/Ron_Sher)\
**Post date:** [August 29, 2015, 6:24am UTC](https://discuss.elastic.co/t/unable-to-delete-child-documents-by-query-that-uses-has-parent-es-1-4-1/28276/1 "2015-08-29T06:24:05Z")

</div>

Hi,

I'm using the query below in my search to find all users without parents.  
The search works as expected, but delete by query fails with has\_parent] query and filter unsupported in delete\_by\_query api

I've searched and it seems that it should be supported.

Anything that I'm missing?

```
{
  "query": {
    "bool": {
      "must": [
        {
          "term": {
            "user.service_id": "12345"
          }
        },
        {
          "filtered": {
            "filter": {
              "not": {
                "filter": {
                  "has_parent": {
                    "query": {
                      "match_all": {}
                    },
                    "parent_type": "account"
                  }
                }
              }
            }
          }
        }
      ]
    }
  }
}
```

---

<div class="post-metadata">

**Author:** ![Ron\_Sher](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ron_sher/32/4472_2.png) [@Ron\_Sher](https://discuss.elastic.co/u/Ron_Sher)\
**Post date:** [September 5, 2015, 8:33pm UTC](https://discuss.elastic.co/t/unable-to-delete-child-documents-by-query-that-uses-has-parent-es-1-4-1/28276/2 "2015-09-05T20:33:03Z")

</div>

just saw a reply from another thread that it's not supported.

See [https://www.elastic.co/guide/en/elasticsearch/reference/current/docs-delete-by-query.html#limitations](https://www.elastic.co/guide/en/elasticsearch/reference/current/docs-delete-by-query.html#limitations)

---

<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:51pm UTC](https://discuss.elastic.co/t/unable-to-delete-child-documents-by-query-that-uses-has-parent-es-1-4-1/28276/3 "2017-07-05T23:51:57Z")

</div>


