Benson, I think the idea is that Tokenizers are created as needed (from
the TokenizerFactory), while those other objects are singular (one
created for each corresponding stanza in solrconfig.xml). So Tokenizers
should be short-lived; they'll be cleaned up after each use, and the
assumption is you wouldn't need to do any cleanup yourself; rather just
let the garbage collector do its work -- assuming these are per-document
resources. But if you have longer-lived resources, maybe you could
manage them in the TokenizerFactory, which will be a singleton? Or in
UpdateRequestProcessFactory, like you suggested
-Mike
On 5/29/13 7:36 AM, Benson Margulies wrote:
I am currently testing some things with Solr 4.0.0. I tried to make a
tokenizer CoreAware, and was rewarded with:
Caused by: org.apache.solr.common.SolrException: Invalid 'Aware'
object: com.basistech.rlp.solr.RLPTokenizerFactory@19336006 --
org.apache.solr.util.plugin.SolrCoreAware must be an instance of:
[org.apache.solr.request.SolrRequestHandler]
[org.apache.solr.response.QueryResponseWriter]
[org.apache.solr.handler.component.SearchComponent]
[org.apache.solr.update.processor.UpdateRequestProcessorFactory]
[org.apache.solr.handler.component.ShardHandlerFactory]
I need this to allow cleanup of some cached items in the tokenizer.
Questions:
1: will a newer version allow me to do this directly?
2: is there some other approach that anyone would recommend? I could,
for example, make a fake object in the list above to act as a
singleton with a static accessor, but that seems pretty ugly.