以下是我正在尝试的代码
String zkHostString = "zookeepername";
CloudSolrServer cloudSolrServer=new CloudSolrServer(zkHostString);
cloudSolrServer.setDefaultCollection("collectionname");
SolrPingResponse ping = cloudSolrServer.ping();
System.out.println("ping -->"+ping);
SolrPingResponse rsp=new SolrPingResponse();