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


(Ron Sher) #1

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"
                  }
                }
              }
            }
          }
        }
      ]
    }
  }
}

(Ron Sher) #2

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


(system) #3