# Can REST API \_msearch support new feature response filter?

**URL:** <https://discuss.elastic.co/t/can-rest-api--msearch-support-new-feature-response-filter/25598>\
**Category:** Elasticsearch\
**Created:** [July 15, 2015, 9:28am UTC](https://discuss.elastic.co/t/can-rest-api--msearch-support-new-feature-response-filter/25598 "2015-07-15T09:28:38Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![JoshuaZe](https://avatars.discourse-cdn.com/v4/letter/j/5daacb/32.png) [@JoshuaZe](https://discuss.elastic.co/u/JoshuaZe)\
**Post date:** [July 15, 2015, 9:28am UTC](https://discuss.elastic.co/t/can-rest-api--msearch-support-new-feature-response-filter/25598/1 "2015-07-15T09:28:38Z")

</div>

I used the new feature ( **JSON response body filtering** ) under elasticsearch1.6.0, but failed with API **\_msearch**.  
I tried **\_search** api, it works (the URL filter\_path is the same as \_msearch URL).  
But **when i use \_msearch, it only returns "{}"**.  
the _msearch URL shows below:  
 [http://10.249.68.154:9200/seasonal\_yr5](http://10.249.68.154:9200/seasonal_yr5)_\*/kw/\_msearch?pretty&filter\_path=aggregations.timeseries.buckets.key\_as\_string,aggregations.timeseries.buckets.sum\_quantity.value

---

<div class="post-metadata">

**Author:** ![colings86](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/colings86/32/44960_2.png) [@colings86](https://discuss.elastic.co/u/colings86)\
**Post date:** [July 15, 2015, 12:35pm UTC](https://discuss.elastic.co/t/can-rest-api--msearch-support-new-feature-response-filter/25598/2 "2015-07-15T12:35:48Z")

</div>

According to the [`_msearch` documentation](https://www.elastic.co/guide/en/elasticsearch/reference/current/search-multi-search.html), the response will have an array called `responses` which will contain the response for each of your searches. Your filterpath does not include that array, it assumes that there will be a field in the root of the JSON called `aggregations`. try setting you `filter_path` to include `responses`:

```auto
responses.aggregations.timeseries.buckets.key_as_string,aggregations.timeseries.buckets.sum_quantity.value

```

If that doesn't work, run your `_msearch` request without any `filter_path` and check the structure of the response to see what you are missing.

---

<div class="post-metadata">

**Author:** ![JoshuaZe](https://avatars.discourse-cdn.com/v4/letter/j/5daacb/32.png) [@JoshuaZe](https://discuss.elastic.co/u/JoshuaZe)\
**Post date:** [July 20, 2015, 6:39am UTC](https://discuss.elastic.co/t/can-rest-api--msearch-support-new-feature-response-filter/25598/3 "2015-07-20T06:39:23Z")

</div>

it works.  
thank you very much.

---

<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 6, 2017, 12:00am UTC](https://discuss.elastic.co/t/can-rest-api--msearch-support-new-feature-response-filter/25598/4 "2017-07-06T00:00:26Z")

</div>

Closed on July 6, 2017, 12:00am UTC


