# Shard query cache without specifying search\_type parameter

**URL:** <https://discuss.elastic.co/t/shard-query-cache-without-specifying-search-type-parameter/22178>\
**Category:** Elasticsearch\
**Created:** [February 15, 2015, 7:52pm UTC](https://discuss.elastic.co/t/shard-query-cache-without-specifying-search-type-parameter/22178 "2015-02-15T19:52:45Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Yizhar\_Gilboa](https://avatars.discourse-cdn.com/v4/letter/y/8797f3/32.png) [@Yizhar\_Gilboa](https://discuss.elastic.co/u/Yizhar_Gilboa)\
**Post date:** [February 15, 2015, 7:52pm UTC](https://discuss.elastic.co/t/shard-query-cache-without-specifying-search-type-parameter/22178/1 "2015-02-15T19:52:45Z")

</div>

Hi all,  
I need to calculate aggregations for every search request since my UI  
requires it.  
For performance considerations I ended up splitting every search request to  
2, the first to do the information retrieval itself and another to  
aggregate the results while using the query cache by specifying  
search\_type=count.

Is there a way for me to do both requests in one? e.g, to change the search  
type to a type that knows to use the cache when possible?

Thanks a lot!

--  
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/2dbf9aaa-b7df-4475-adac-88602e088fe6%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/2dbf9aaa-b7df-4475-adac-88602e088fe6%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:32am UTC](https://discuss.elastic.co/t/shard-query-cache-without-specifying-search-type-parameter/22178/2 "2017-07-06T00:32:41Z")

</div>


