Elasticsearch caches filters and filter evictions can happen for two reasons:
you have a rapidly changing index and deleted "segments" trigger evictions of the cache entries that are associated to them
you use a lot of filters that elasticsearch can't all cache so elasticsearch will evict the least-recently used filters in order to make room for new filters
4.7 filter evictions per query is indeed quite high. You can look at your queries to see if there are filters that you do not reuse, in which case it would help to turn off caching explicitly (_cache: false).
Note: lots of improvements about filter caching are coming to 2.0 which should make this situation better.
Not sure if these really filter evictions are really a concern, but sure, this served as an indication some metric is out of ordinary range. From elasticsearch user point of view, do you face queries become slow even with filter evictions happened? We have this same issue too but when we make queries, the response duration still at acceptable range.
Clinton wrote a nice explanation of what segments are at lucene - Understanding Segments in Elasticsearch - Stack Overflow. Your data is stored into immutable segments and we rely on this for filter caching: since segments don't change the cache never needs invalidation. However updating the index sometimes requires to add new segments, merge existing segments together and remove old segments. When an old segment is removed, we just trash everything that was cached on that segment.
Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant
logo are trademarks of the
Apache Software Foundation
in the United States and/or other countries.