Solr通过代码创建collection

Solr可以通过代码来创建

			HttpSolrServer server = new HttpSolrServer(SOLR_URL);
			//这个是solrCloud的
//			CollectionAdminResponse res = CollectionAdminRequest.createCollection("collection1", "", "solrconfig.xml", server);
//			boolean f = res.isSuccess();
			//这个是solr Core的
			CoreAdminResponse res = CoreAdminRequest.createCore("collection1", "collection1", server);
			System.out.println(res.getStatus());


你可能感兴趣的:(Solr)