: 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.

If you have some reason why you can't or don't want to use a SolrCache,
the other trick you can use is to have a special query param on your
RequestHandler that tells it to do a bunch of work that will load the data
into your cache, and then configure firstSearcher and newSearcher events
to "ping" your handler with that param...

    <listener event="newSearcher" class="solr.QuerySenderListener">
      <arr name="queries">
        <lst> <str name="qt">your_custom_hanler</str>
              <str name="forfce_cache_update">1</str>
        </lst>
      </arr>
    </listener>

I recommend using a SolrCache instead of this approach though, because a
Regenerators for SolrCaches have the benefit of knowinging state from the
old cache when they populate the new cache. ... but this appraoch works
really well for "pre-filling" a cache on server start up (firstSearcher)


-Hoss

Reply via email to