| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556 | [[index-modules-cache]]== CacheThere are different caching inner modules associated with an index. Theyinclude `filter` and others.[float][[filter]]=== Filter CacheThe filter cache is responsible for caching the results of filters (usedin the query). The default implementation of a filter cache (and the onerecommended to use in almost all cases) is the `node` filter cache type.[float][[node-filter]]==== Node Filter CacheThe `node` filter cache may be configured to use either a percentage ofthe total memory allocated to the process or an specific amount ofmemory. All shards present on a node share a single node cache (thatswhy its called `node``). The cache implements an LRU eviction policy:when a cache becomes full, the least recently used data is evicted tomake way for new data.The setting that allows one to control the memory size for the filtercache is `indices.cache.filter.size`, which defaults to `20%`. *Note*,this is *not* an index level setting but a node level setting (can beconfigured in the node configuration).`indices.cache.filter.size` can accept either a percentage value, like`30%`, or an exact value, like `512mb`.[float][[index-filter]]==== Index Filter CacheA filter cache that exists on the index level (on each node). Generally,not recommended for use since its memory usage depends on which shardsare allocated on each node and its hard to predict it. The types are:`resident`, `soft` and `weak`.All types support the following settings:[cols="<,<",options="header",]|=======================================================================|Setting |Description|`index.cache.filter.max_size` |The max size (count, not byte size) ofthe cache (per search segment in a shard). Defaults to not set (`-1`),which is usually fine with `soft` cache and proper cacheable filters.|`index.cache.filter.expire` |A time based setting that expires filtersafter a certain time of inactivity. Defaults to `-1`. For example, canbe set to `5m` for a 5 minute expiry.|=======================================================================
 |