On 12/4/2013 9:23 AM, Artem Karpenko wrote:
> so it's SolrZkClient indeed. I've tried it out and it seems to do just
> the job I need. Thank you!
> 
> On a related note - is there a similar way to create/reload
> core/collection, using maybe CloudSolrServer or smth. inside it? Didn't
> found any methods that could do the thing.

This should probably work for reloading collection1.  I can't test it
right now, as I'm about to start my morning commute.

CloudSolrServer srv =
new CloudSolrServer("zoo1:2181,zoo2:2181,zoo3:2181/mysolr");
srv.setDefaultCollection("collection2");
SolrQuery q = new SolrQuery();
q.setRequestHandler("/admin/collections");
q.set("action", "RELOAD");
q.set("name", "collection1");
QueryResponse x = srv.query(q);

If you want to reload an individual core, you'd need to use
HttpSolrServer, not CloudSolrServer.  SOLR-4140 made it possible to use
the collections API with CloudSolrServer, but as far as I can tell, it
doesn't enable the CoreAdmin API.

Note that reloads don't work right with SolrCloud unless the server
version is at least 4.4, due to a bug.

Thanks,
Shawn

Reply via email to