On May 10, 2006, at 6:38 PM, Erik Hatcher wrote:
On May 10, 2006, at 5:31 PM, Chris Hostetter wrote:


: Great question... it should be, as it's created and registered in the
: SolrIndexSearcher constructor.  is the cache .name() returning the
: right thing?

I was just about to ask that. it wasn't untill i started digging into
CacheCOnfig and SolrIndexSearcher because of this thread that i realized it doesn't matter what "name" attribute you give your cache in the config, the SolrCache implimentation itself is responsible for specifying the name that can be used to access the searcher with SolrIndexSearcher.getCache()

if you define your MyCache.name function to be...

   public String name() { return "foo"; }

then even if you have...

     <cache name="facet_cache"
       class="org.foo.MyCache"
     />

...you'll access your cache using the name "foo".

Ah, that was an issue in my code then. I simply had all of the "unnecessary" methods implemented returning a default value (null for Object return values). I now return the value of args.get ("name") which is "facet_cache" in my case... but I'm still getting the same NPE.

Uh, never mind.... my e-mail was written over the course of a few minutes as I was trying things, and I inadvertently returned the name from getName() instead of name(). All is now well.

        Erik

Reply via email to