difference between flush request and emptying cache for elasticsearch

1.6k views Asked by At

What is the difference between between issuing a flush request and emptying the cache for elasticsearch? Does a restart of elasticsearch achieve either of these?

1

There are 1 answers

0
javanna On BEST ANSWER

If you mean the difference between flush and clear cache api, it is pretty big.

Flush issues a lucene commit and empties the elasticsearch transaction log. As a result it gives durability on the lucene index level (that's why the translog can be emptied). Flush is called automatically under the hood at regular intervals that are adaptive depending on how many documents you index, how big they are and when the last flush was. You don't normally call flush, unless you are doing maintenance on the indices.

Clear cache empties the elasticsearch caches that are used to make search faster, for instance when it comes to executing the same filters or the same facets. There are different types of caches, but they are all at this time stored in memory (java heap).