# Does the native Java client transparently cache search results?

**URL:** <https://discuss.elastic.co/t/does-the-native-java-client-transparently-cache-search-results/20641>\
**Category:** Elasticsearch\
**Created:** [November 7, 2014, 8:21pm UTC](https://discuss.elastic.co/t/does-the-native-java-client-transparently-cache-search-results/20641 "2014-11-07T20:21:25Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Ian\_Clarke](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ian_clarke/32/1116_2.png) [@Ian\_Clarke](https://discuss.elastic.co/u/Ian_Clarke)\
**Post date:** [November 7, 2014, 8:21pm UTC](https://discuss.elastic.co/t/does-the-native-java-client-transparently-cache-search-results/20641/1 "2014-11-07T20:21:25Z")

</div>

We're seeing surprisingly good performance in some testing we're doing,  
taking just 0.1ms while repeatedly executing the same query, here is the  
relevant code: [https://gist.github.com/sanity/c825c69de3ab9a991640](https://gist.github.com/sanity/c825c69de3ab9a991640) We see  
this whether ES is running on the same machine as the client code, or on a  
different EC2 machine. This seems surprisingly performant.

I'm wondering if maybe this is due to some caching within the client code,  
given that the search query is identical each time?

Would appreciate any input.

Ian.

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/df781f70-6fb7-43ee-853d-b1822d40b4eb%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/df781f70-6fb7-43ee-853d-b1822d40b4eb%40googlegroups.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<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:51am UTC](https://discuss.elastic.co/t/does-the-native-java-client-transparently-cache-search-results/20641/2 "2017-07-06T00:51:25Z")

</div>

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


