Skip to content

Apache Lucene open-source search software

SOLR-11628: Add documentation of maxRamMB for filter cache and query result cache

Shalin Shekhar Mangarb03c7249d3a5
diff --git a/solr/CHANGES.txt b/solr/CHANGES.txt
index 2415906b680..9b96be3a524 100644
--- a/solr/CHANGES.txt
+++ b/solr/CHANGES.txt
@@ -148,6 +148,8 @@ Other Changes
* SOLR-11621: Fix spurious failures of TriggerIntegrationTest due to timing issues. (shalin)
+* SOLR-11628: Add documentation of maxRamMB for filter cache and query result cache. (shalin)
+
================== 7.1.0 ==================
Consult the LUCENE_CHANGES.txt file for additional, low level, changes in this release.
diff --git a/solr/solr-ref-guide/src/query-settings-in-solrconfig.adoc b/solr/solr-ref-guide/src/query-settings-in-solrconfig.adoc
index 31185b6dcd9..e5c18db0777 100644
--- a/solr/solr-ref-guide/src/query-settings-in-solrconfig.adoc
+++ b/solr/solr-ref-guide/src/query-settings-in-solrconfig.adoc
@@ -59,19 +59,30 @@ The most typical way Solr uses the `filterCache` is to cache results of each `fq
Solr also uses this cache for faceting when the configuration parameter `facet.method` is set to `fc`. For a discussion of faceting, see <<searching.adoc#searching,Searching>>.
+The filter cache uses a specialized cache named as FastLRUCache which is optimized for fast concurrent access with the trade-off that writes and evictions are costlier than the LRUCache used for query result cache and document cache.
+
[source,xml]
----
-<filterCache class="solr.LRUCache"
+<filterCache class="solr.FastLRUCache"
size="512"
initialSize="512"
autowarmCount="128"/>
----
+The FastLRUCache used for filter cache also supports a `maxRamMB` parameter which restricts the maximum amount of heap used by this cache. The FastLRUCache only supports evictions by either heap usage or size but not both. Therefore, the `size` parameter is ignored if `maxRamMB` is specified.
+
+[source,xml]
+----
+<filterCache class="solr.FastLRUCache"
+ maxRamMB="1000"
+ autowarmCount="128"/>
+----
+
=== queryResultCache
This cache holds the results of previous searches: ordered lists of document IDs (DocList) based on a query, a sort, and the range of documents requested.
-The `queryResultCache` has an additional (optional) setting to limit the maximum amount of RAM used (`maxRamMB`). This lets you specify the maximum heap size, in megabytes, used by the contents of this cache. When the cache grows beyond this size, oldest accessed queries will be evicted until the heap usage of the cache decreases below the specified limit.
+The `queryResultCache` has an additional (optional) setting to limit the maximum amount of RAM used (`maxRamMB`). This lets you specify the maximum heap size, in megabytes, used by the contents of this cache. When the cache grows beyond this size, oldest accessed queries will be evicted until the heap usage of the cache decreases below the specified limit. If a `size` is specified in addition to `maxRamMB` then both heap usage and maximum size limits are respected.
[source,xml]
----