If you are doing this in a RequestHandler, implement SolrCoreAware and
you will get a callback with the Core
http://wiki.apache.org/solr/SolrPlugins#head-8b3ac1fc3584fe1e822924b98af23d72b02ab134
On Mar 12, 2009, at 3:04 PM, Pascal Dimassimo wrote:
I found this code to access other core from my custom requesthandler:
CoreContainer.Initializer initializer = new
CoreContainer.Initializer();
CoreContainer cores = initializer.initialize();
SolrCore otherCore = cores.getCore("otherCore");
It seems to work with some little testing. But is it a recommended
approach?
Pascal Dimassimo wrote:
Hi,
I've designed a "front" handler that will send request to other
handlers
and return a aggregated response.
Inside this handler, I call other handlers like this (inside the
method
handleRequestBody):
SolrCore core = req.getCore();
SolrRequestHandler mlt = core.getRequestHandler("/mlt");
ModifiableSolrParams params = new
ModifiableSolrParams(req.getParams());
params.set("mlt.fl", "nFullText");
req.setParams(params);
mlt.handleRequest(req, rsp);
First question: is this the recommended way to call another handler?
Second question: how could I call a handler of another core?
--
View this message in context:
http://www.nabble.com/Programmatic-access-to-other-handlers-tp22477731p22483357.html
Sent from the Solr - User mailing list archive at Nabble.com.