How can I use CollectionAdminRequest.Create in SolrJ to create a new collection in SolrCloud running with zookeeper.
I tried
public void createIndex(String targetUuid) {
HttpSolrClient solrClient = new HttpSolrClient.Builder("http://localhost:8983/solr/").build();
try {
// 1. Create Index with two shards and one replicas
if(uploadConfigset()) {
//Error Here
CollectionAdminRequest.Create creator = new CollectionAdminRequest.Create(targetUuid,"tg_configset",1,2,0,0);
creator.setMaxShardsPerNode(2);
creator.process(solrClient);
}
} catch (IOException | SolrServerException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
But can not use CollectionAdminRequest.Create as its constructor is 'protected'