ElasticSearch refresh effect on cache ElasticSearch refresh effect on cache elasticsearch elasticsearch

ElasticSearch refresh effect on cache


A refresh causes new documents to be visible for searching. This happens by writing a new index segment. A new segment can also be made by merging old large ones.

Filter- and field caches are managed per segment, since a segment is immutable. You can use the warmer APIs to ensure caches are pre-warmed before being made available for search. If not, then parts of the cache is essentially "cleared".

A flush in Elasticsearch terms actually calls a Lucene commit. This is quite more expensive.

If you have a write heavy app, you probably want to increase the refresh interval to get better indexing throughput.

There's some more details about these things in these two articles: