I am new to apache solr.
I want to manipulate the multicore dynamically using CoreAdminHandler class of
org.apache.solr.handler.admin.CoreAdminHandler;
There are no tutorials on how to use it nor any good example I could google out.
Please give me some example of how can I manipulate multicore which are deployed in tomcat(not embedded) using CoreAdminHandler and solrj.
How can I specify the path of my tomcat server where solr is deployed for CoreAdminHandler/coreContainer.
And how to specify the path where multicores are placed?
Here is an example you can use to get the list of the available cores through a status request:
CoreAdminRequest adminRequest = new CoreAdminRequest();
adminRequest.setAction(CoreAdminAction.STATUS);
CoreAdminResponse adminResponse = adminRequest.process(new CommonsHttpSolrServer(solrUrl));
NamedList<NamedList<Object>> coreStatus = adminResponse.getCoreStatus();
The following are the available CoreAdmin
actions you can use:
STATUS,
LOAD,
UNLOAD,
RELOAD,
CREATE,
PERSIST,
SWAP,
RENAME,
@Deprecated
ALIAS,
MERGEINDEXES;
The code you can use is pretty much the same, you just have to pick the right action and correctly read the results within the returned NamedList
object. Let me know if you have some more specific question.