# Shard query cache and filters with \_cache:false

**URL:** https://discuss.elastic.co/t/shard-query-cache-and-filters-with--cache-false/23683
**Category:** Elasticsearch
**Created:** [May 25, 2015, 9:04pm UTC](https://discuss.elastic.co/t/shard-query-cache-and-filters-with--cache-false/23683 "2015-05-25T21:04:19Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![msukmanowsky](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/msukmanowsky/32/44771_2.png) [@msukmanowsky](https://discuss.elastic.co/u/msukmanowsky)
#### Post date: [May 25, 2015, 9:04pm UTC](https://discuss.elastic.co/t/shard-query-cache-and-filters-with--cache-false/23683/1 "2015-05-25T21:04:19Z")

</div>

Is the shard query cache disabled if a filter is specified in  
query.filter.filtered.bool.must clause has \_cache: false? It makes some  
intuitive sense if it's the case, but looking over the source code  
[https://github.com/elastic/elasticsearch/blob/1.4/src/main/java/org/elasticsearch/indices/cache/query/IndicesQueryCache.java#L169-L200](https://github.com/elastic/elasticsearch/blob/1.4/src/main/java/org/elasticsearch/indices/cache/query/IndicesQueryCache.java#L169-L200)  
(we're  
using 1.4.3), I can't see any reason why this would happen yet it seems to  
on most of our queries (confirmed it's enabled in our settings at 2% of  
heap).

--  
Mike Sukmanowsky  
Aspiring Digital Carpenter

_p_: +1 (416) 953-4248  
_e_: [mike.sukmanowsky@gmail.com](mailto:mike.sukmanowsky@gmail.com)

facebook [http://facebook.com/mike.sukmanowsky](http://facebook.com/mike.sukmanowsky) | twitter  
[http://twitter.com/msukmanowsky](http://twitter.com/msukmanowsky) | LinkedIn  
[http://www.linkedin.com/profile/view?id=10897143](http://www.linkedin.com/profile/view?id=10897143) | github  
[https://github.com/msukmanowsky](https://github.com/msukmanowsky)

## -- Please update your bookmarks! We have moved to [https://discuss.elastic.co/](https://discuss.elastic.co/)

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/CAOH6cu5CdGB0HS%2BraR\_4JZ%2BQwSZ--JVxcD6FQSYvewmwvH4q3A%40mail.gmail.com](https://groups.google.com/d/msgid/elasticsearch/CAOH6cu5CdGB0HS%2BraR_4JZ%2BQwSZ--JVxcD6FQSYvewmwvH4q3A%40mail.gmail.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

### Author: ![jpountz](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jpountz/32/45836_2.png) [@jpountz](https://discuss.elastic.co/u/jpountz)
#### Post date: [May 27, 2015, 3:35pm UTC](https://discuss.elastic.co/t/shard-query-cache-and-filters-with--cache-false/23683/2 "2015-05-27T15:35:10Z")

</div>

The query cache is completely independent from the filter cache, so  
disabling caching on a filter won't disable the query cache.

On Mon, May 25, 2015 at 11:04 PM, Mike Sukmanowsky \<  
[mike.sukmanowsky@gmail.com](mailto:mike.sukmanowsky@gmail.com)\> wrote:

> Is the shard query cache disabled if a filter is specified in  
> query.filter.filtered.bool.must clause has \_cache: false? It makes some  
> intuitive sense if it's the case, but looking over the source code  
> [https://github.com/elastic/elasticsearch/blob/1.4/src/main/java/org/elasticsearch/indices/cache/query/IndicesQueryCache.java#L169-L200](https://github.com/elastic/elasticsearch/blob/1.4/src/main/java/org/elasticsearch/indices/cache/query/IndicesQueryCache.java#L169-L200) (we're  
> using 1.4.3), I can't see any reason why this would happen yet it seems to  
> on most of our queries (confirmed it's enabled in our settings at 2% of  
> heap).
> 
> --  
> Mike Sukmanowsky  
> Aspiring Digital Carpenter
> 
> _p_: +1 (416) 953-4248  
> _e_: [mike.sukmanowsky@gmail.com](mailto:mike.sukmanowsky@gmail.com)
> 
> facebook [http://facebook.com/mike.sukmanowsky](http://facebook.com/mike.sukmanowsky) | twitter  
> [http://twitter.com/msukmanowsky](http://twitter.com/msukmanowsky) | LinkedIn  
> [http://www.linkedin.com/profile/view?id=10897143](http://www.linkedin.com/profile/view?id=10897143) | github  
> [https://github.com/msukmanowsky](https://github.com/msukmanowsky)
> 
> ## -- Please update your bookmarks! We have moved to [https://discuss.elastic.co/](https://discuss.elastic.co/)
> 
> 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/CAOH6cu5CdGB0HS%2BraR\_4JZ%2BQwSZ--JVxcD6FQSYvewmwvH4q3A%40mail.gmail.com](https://groups.google.com/d/msgid/elasticsearch/CAOH6cu5CdGB0HS%2BraR_4JZ%2BQwSZ--JVxcD6FQSYvewmwvH4q3A%40mail.gmail.com)  
> [https://groups.google.com/d/msgid/elasticsearch/CAOH6cu5CdGB0HS%2BraR\_4JZ%2BQwSZ--JVxcD6FQSYvewmwvH4q3A%40mail.gmail.com?utm\_medium=email&utm\_source=footer](https://groups.google.com/d/msgid/elasticsearch/CAOH6cu5CdGB0HS%2BraR_4JZ%2BQwSZ--JVxcD6FQSYvewmwvH4q3A%40mail.gmail.com?utm_medium=email&utm_source=footer)  
> .  
> For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

--  
Adrien

## -- Please update your bookmarks! We have moved to [https://discuss.elastic.co/](https://discuss.elastic.co/)

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/CAO5%3DkAhsMtdu2ptvpfctcoz59pvVfnqsnrdJ2FhmksgHWyS6gQ%40mail.gmail.com](https://groups.google.com/d/msgid/elasticsearch/CAO5%3DkAhsMtdu2ptvpfctcoz59pvVfnqsnrdJ2FhmksgHWyS6gQ%40mail.gmail.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:11am UTC](https://discuss.elastic.co/t/shard-query-cache-and-filters-with--cache-false/23683/3 "2017-07-06T00:11:34Z")

</div>


