Solr通过代码创建collection

来源:互联网 发布:linux如何设置ftp账户 编辑:程序博客网 时间:2024/04/28 14:53

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());


0 0
原创粉丝点击