# Cached filters and NRT search

**URL:** <https://discuss.elastic.co/t/cached-filters-and-nrt-search/5036>\
**Category:** Elasticsearch\
**Created:** [August 2, 2011, 9:00pm UTC](https://discuss.elastic.co/t/cached-filters-and-nrt-search/5036 "2011-08-02T21:00:26Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![otisg](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/otisg/32/492_2.png) [@otisg](https://discuss.elastic.co/u/otisg)\
**Post date:** [August 2, 2011, 9:00pm UTC](https://discuss.elastic.co/t/cached-filters-and-nrt-search/5036/1 "2011-08-02T21:00:26Z")

</div>

Hello,

On [http://www.elasticsearch.org/guide/reference/query-dsl/](http://www.elasticsearch.org/guide/reference/query-dsl/) there is a  
section on Filters and Caching.  
My question is - how does caching filters work with NRT search?  
If results are constantly changing (assuming continuous indexing  
here), how do cached filters remain valid?

## Thanks, Otis

Sematext is hiring Search Engineers -- [http://sematext.com/about/jobs.html](http://sematext.com/about/jobs.html)

---

<div class="post-metadata">

**Author:** ![kimchy](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/kimchy/32/44952_2.png) [@kimchy](https://discuss.elastic.co/u/kimchy)\
**Post date:** [August 2, 2011, 9:07pm UTC](https://discuss.elastic.co/t/cached-filters-and-nrt-search/5036/2 "2011-08-02T21:07:42Z")

</div>

Json already have numeric types and boolean types, so those are used based  
on it. Date types are automatically detected if the string matches  
predefined (though configurable) date formats (more info here:  
[Elasticsearch Platform — Find real-time answers at scale | Elastic](http://www.elasticsearch.org/guide/reference/mapping/root-object-type.html)).

On Wed, Aug 3, 2011 at 12:00 AM, Otis Gospodnetic \<  
[otis.gospodnetic@gmail.com](mailto:otis.gospodnetic@gmail.com)\> wrote:

> Hello,
> 
> On [Elasticsearch Platform — Find real-time answers at scale | Elastic](http://www.elasticsearch.org/guide/reference/query-dsl/) there is a  
> section on Filters and Caching.  
> My question is - how does caching filters work with NRT search?  
> If results are constantly changing (assuming continuous indexing  
> here), how do cached filters remain valid?
> 
> ## Thanks, Otis
> 
> Sematext is hiring Search Engineers -- [Jobs - Sematext](http://sematext.com/about/jobs.html)

---

<div class="post-metadata">

**Author:** ![kimchy](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/kimchy/32/44952_2.png) [@kimchy](https://discuss.elastic.co/u/kimchy)\
**Post date:** [August 2, 2011, 9:10pm UTC](https://discuss.elastic.co/t/cached-filters-and-nrt-search/5036/3 "2011-08-02T21:10:03Z")

</div>

Answered the wrong thread there. Filters are cached on the segment level  
without the need to refresh them if deletes happen. So, big segments will  
have those filters "heavily" cached, while small flushed NRT segments will  
get those refilled, but only for that segment.

On Wed, Aug 3, 2011 at 12:00 AM, Otis Gospodnetic \<  
[otis.gospodnetic@gmail.com](mailto:otis.gospodnetic@gmail.com)\> wrote:

> Hello,
> 
> On [Elasticsearch Platform — Find real-time answers at scale | Elastic](http://www.elasticsearch.org/guide/reference/query-dsl/) there is a  
> section on Filters and Caching.  
> My question is - how does caching filters work with NRT search?  
> If results are constantly changing (assuming continuous indexing  
> here), how do cached filters remain valid?
> 
> ## Thanks, Otis
> 
> Sematext is hiring Search Engineers -- [Jobs - Sematext](http://sematext.com/about/jobs.html)

---

<div class="post-metadata">

**Author:** ![otisg](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/otisg/32/492_2.png) [@otisg](https://discuss.elastic.co/u/otisg)\
**Post date:** [August 2, 2011, 10:12pm UTC](https://discuss.elastic.co/t/cached-filters-and-nrt-search/5036/4 "2011-08-02T22:12:54Z")

</div>

Ah, of course! Thanks.

## Otis

Sematext is hiring Search Engineers -- [Jobs](http://sematext.com/about/jobs.html)

On Aug 2, 5:10 pm, Shay Banon [kim...@gmail.com](mailto:kim...@gmail.com) wrote:

> Answered the wrong thread there. Filters are cached on the segment level  
> without the need to refresh them if deletes happen. So, big segments will  
> have those filters "heavily" cached, while small flushed NRT segments will  
> get those refilled, but only for that segment.
> 
> On Wed, Aug 3, 2011 at 12:00 AM, Otis Gospodnetic \<
> 
> [otis.gospodne...@gmail.com](mailto:otis.gospodne...@gmail.com)\> wrote:
> 
> > Hello,
> 
> > Onhttp://www.elasticsearch.org/guide/reference/query-dsl/there is a  
> > section on Filters and Caching.  
> > My question is - how does caching filters work with NRT search?  
> > If results are constantly changing (assuming continuous indexing  
> > here), how do cached filters remain valid?
> 
> > ## Thanks, Otis
> > 
> > Sematext is hiring Search Engineers --[Jobs](http://sematext.com/about/jobs.html)

---

<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, 3:58am UTC](https://discuss.elastic.co/t/cached-filters-and-nrt-search/5036/5 "2017-07-06T03:58:25Z")

</div>


