# Filtering by the Java Transport Client

**URL:** <https://discuss.elastic.co/t/filtering-by-the-java-transport-client/44448>\
**Category:** Elasticsearch\
**Created:** [March 15, 2016, 3:16pm UTC](https://discuss.elastic.co/t/filtering-by-the-java-transport-client/44448 "2016-03-15T15:16:29Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![BennoSI](https://avatars.discourse-cdn.com/v4/letter/b/67e7ee/32.png) [@BennoSI](https://discuss.elastic.co/u/BennoSI)\
**Post date:** [March 15, 2016, 3:16pm UTC](https://discuss.elastic.co/t/filtering-by-the-java-transport-client/44448/1 "2016-03-15T15:16:29Z")

</div>

Hi,

I'm new to ES and I'm using the Java Transport client to perfom searches. I read about queries and filters and that for performance reasons there should be used filters before queries, because filters can be cached. Now I'm wondering where to set the filter in the Transport Client, I see the methods setQuery() and setPostFilter(). Which method should I use, if I want to perform a search on structured data, without the need of scoring, I also do not need the fulltext index. If possible I want to make usage of caching as much as possible.

Many thanks for your help.

regards, Benno

---

<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:08pm UTC](https://discuss.elastic.co/t/filtering-by-the-java-transport-client/44448/2 "2017-07-05T23:08:16Z")

</div>

Closed on July 5, 2017, 11:08pm UTC


