queryResultCache in SOLR

2019-05-26 22:18发布

问题:

I am wondering if queryResultCache in solrconfig.xml caches anything blindly or only successfully handled results? That is I don't want to cache failed query's results.

Also I see some attribute called "autowarmCount" in the queryResultCache definition.

<queryResultCache
   class="solr.LRUCache"
   size="16384"
   initialSize="16384"
   autowarmCount="128"/>

Can I specify queries for auto warming up? Or can it figure out itself what queries to use?

回答1:

The queryResultCache will only store results from successfully handled results.

Yes you can specify the queries to use for the autowarming. From the Solr Reference Guide on Caches, please see the Query-Related Listeners section for details on how the queries can be specified when searchers are either frist created or newly created to replace an existing searcher in Solr.

Also please note that the following (also from the Reference Guide):

When a new searcher is opened, the current searcher continues servicing requests while the new one auto-warms its cache. The new searcher uses the current searcher's cache to pre-populate its own.



标签: solr lucene