: : Unfortunately the facet fields are not static. The field are dynamic SOLR : fields and are generated by different applications. : The field names will be populated into a data store (like memcache) and : facets have to be driven from that data store. : : I need to write a Custom FacetComponent which picks up the facet fields from : the data store.
It sounds like you don't need custom facet *code* you just need to dynamicly decide what fields to facet on -- i would suggest in that case that instead of subclassing FacetComponent you instead write a standalone SearchComponent that you configure to run before the FacetComponent which would modify the request params to add the new "facet.field" (and any f.*.facet.field.*) params you decide you want ot use at run time -- the more you can decouple your custom code from the existing code, the less maintence headaches you are likely to have. as for your original problem.... : > I'm getting an error saying "Error instantiating SearchComponent <My Custom : > Class> is not a org.apache.solr.handler.component.SearchComponent". : > : > My custom class inherits from *FacetComponent* which extends from * : > SearchComponent*. ...this sounds like it is likely a problem with the classloaders -- even though you subclass FacetComponent, if a differnet "branch" of the classloader tree loads your custom code, it may not recognize that the FacetCOmponet class instance you subclass is the same as the FacetComponent class it already knows about. where exactly did you put the class/jar contianing your subclass? did you you specify a <lib/> directive in your solrconfig.xml for it? if you added/moved/copied *any* jars into "example/lib" that's a good tip off that you made a mistake... https://wiki.apache.org/solr/SolrPlugins#How_to_Load_Plugins -Hoss