Here's an example of the configuration from solrconfig.xml:
<!-- Example of a generic cache. These caches may be accessed by name
through SolrIndexSearcher.getCache(),cacheLookup(), and cacheInsert().
The purpose is to enable easy caching of user/application level data.
The regenerator argument should be specified as an implementation
of solr.search.CacheRegenerator if autowarming is desired. -->
<!--
<cache name="myUserCache"
class="solr.LRUCache"
size="4096"
initialSize="1024"
autowarmCount="1024"
regenerator="org.mycompany.mypackage.MyRegenerator"
/>
-->
-Yonik
On 5/10/06, Yonik Seeley <[EMAIL PROTECTED]> wrote:
On 5/10/06, Erik Hatcher <[EMAIL PROTECTED]> wrote:
> I build a "facet" cache in my request handler, but I need it to get
> refreshed when the index changes. How can my custom request handler
> manage this cache and get notified when the index changes?
The easiest way is to let Solr keep the cache (use a custom user cache
defined in the solrconfig.xml) and implement a Regenerator that is
called to create and refresh a new instance when the searcher is
changed.
Does that suit your needs?
-Yonik