# Filter\_path support in Java Client

**URL:** <https://discuss.elastic.co/t/filter-path-support-in-java-client/303258>\
**Category:** Elasticsearch\
**Tags:** language-clients\
**Created:** [April 26, 2022, 10:02am UTC](https://discuss.elastic.co/t/filter-path-support-in-java-client/303258 "2022-04-26T10:02:48Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Fabrizio\_Fortino](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/fabrizio_fortino/32/1719_2.png) [@Fabrizio\_Fortino](https://discuss.elastic.co/u/Fabrizio_Fortino)\
**Post date:** [April 26, 2022, 10:02am UTC](https://discuss.elastic.co/t/filter-path-support-in-java-client/303258/1 "2022-04-26T10:02:48Z")

</div>

We would like to reduce the response size of search requests by removing stuff we don't need (eg: index name since we are pointing to a single index or score). Elastic supports this through [filter\_path](https://www.elastic.co/guide/en/elasticsearch/reference/current/common-options.html#common-options-response-filtering).

Both RHLC and EJC don't support this option. To achieve that, we are currently using the low-level rest client. Is there any plan to support this option in the new Elasticsearch Java Client?

Thanks

---

<div class="post-metadata">

**Author:** ![swallez](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/swallez/32/11972_2.png) [@swallez](https://discuss.elastic.co/u/swallez)\
**Post date:** [April 26, 2022, 12:07pm UTC](https://discuss.elastic.co/t/filter-path-support-in-java-client/303258/2 "2022-04-26T12:07:02Z")

</div>

Please see [Unable to set query parameters (like `filter_path`) in search requests · Issue #203 · elastic/elasticsearch-java · GitHub](https://github.com/elastic/elasticsearch-java/issues/203#issuecomment-1071062656) to see how to set `filter_path`.

We have deliberately chosen to not expose it as a general feature as it can remove fields that are considered as required in the API specification. In the case of search however it is indeed useful to reduce the size of large responses and we'll add it as a property of `SearchRequest` in a future revision.

---

<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:** [May 24, 2022, 12:07pm UTC](https://discuss.elastic.co/t/filter-path-support-in-java-client/303258/3 "2022-05-24T12:07:55Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
