Elasticsearch caches
Until now we haven't mentioned Elasticsearch caches much in the book. However, as most common systems Elasticsearch users a variety of caches to perform more complicated operations or to speed up performance of heavy data retrieval from disk based Lucene indices. In this section, we will look at the most common caches of Elasticsearch, what they are used for, what are the performance implications of using them, and how to configure them.
Fielddata cache
In the beginning of the book, we discussed that Elasticsearch uses the so called inverted index data structure to quickly and efficiently search through the documents. This is very good when searching and filtering the data, but for features such as aggregations, sorting, or script usage, Elasticsearch needs an un-inverted data structure, because these functions rely on per document data information.
Because of the need for uninverted data, when Elasticsearch was first released it contained and still contains an in memory...