Searching and indexing performance
So far we have uncovered some of the best practices in terms of resources. As memory, CPU, I/O, disks, and network play a big part in choosing the preferred set of system configurations; we can tweak a few settings to improve resources usage for searching and indexing in Elasticsearch and Lucene.
Filter cache
By default, the filters used in Elasticsearch for querying are cached, which means when the query uses filter, Elasticsearch finds the documents related to the filter and stores the filter used as cache. After caching, if any query with the same filters are used it will provide quicker results as filters have been cached to memory. As internally it uses memory, it is wise to set a property to limit the usage of the Filter cache. Though each filter uses less memory, JVM heap size can take a hit if a large number of filters are used. By using the following property, we can limit the amount of Heap memory that can be used for the filter cache:
indices.cache...