# Is it possible to define the routing in body when Deleting by Query?

**URL:** <https://discuss.elastic.co/t/is-it-possible-to-define-the-routing-in-body-when-deleting-by-query/58775>\
**Category:** Elasticsearch\
**Created:** [August 24, 2016, 6:54am UTC](https://discuss.elastic.co/t/is-it-possible-to-define-the-routing-in-body-when-deleting-by-query/58775 "2016-08-24T06:54:08Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![jks](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jks/32/12997_2.png) [@jks](https://discuss.elastic.co/u/jks)\
**Post date:** [August 24, 2016, 6:54am UTC](https://discuss.elastic.co/t/is-it-possible-to-define-the-routing-in-body-when-deleting-by-query/58775/1 "2016-08-24T06:54:08Z")

</div>

So I know we can do this:

```
DELETE /twitter/tweet/_query?routing=1
{
  "query": { 
    "term": {
      "user": "kimchy"
    }
  }
}

```

But is it possible to place the routing as part of the body, such as this?:

```
    DELETE /twitter/tweet/_query
    {
      "query": { 
        "routing": 1,
        "term": {
          "user": "kimchy"
        }
      }
    }
```

---

<div class="post-metadata">

**Author:** ![alexbrasetvik](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/alexbrasetvik/32/15538_2.png) [@alexbrasetvik](https://discuss.elastic.co/u/alexbrasetvik)\
**Post date:** [August 24, 2016, 7:59am UTC](https://discuss.elastic.co/t/is-it-possible-to-define-the-routing-in-body-when-deleting-by-query/58775/2 "2016-08-24T07:59:52Z")

</div>

This is a generic Elasticsearch question, so I moved your question there (from the Elastic Cloud forum).

I don't think that's possible.

Here's the routing docs: [https://www.elastic.co/guide/en/elasticsearch/reference/current/mapping-routing-field.html](https://www.elastic.co/guide/en/elasticsearch/reference/current/mapping-routing-field.html)

However, you should be able to do something close to it using the [\_msearch](https://www.elastic.co/guide/en/elasticsearch/reference/current/search-multi-search.html)-API - put the routing in the search's header.

---

<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, 10:25pm UTC](https://discuss.elastic.co/t/is-it-possible-to-define-the-routing-in-body-when-deleting-by-query/58775/3 "2017-07-05T22:25:41Z")

</div>


