From 4f5426ae94bdfe568ebee24978817f230cd4f9ab Mon Sep 17 00:00:00 2001 From: Mark Robert Miller Date: Fri, 1 Nov 2013 14:14:07 +0000 Subject: [PATCH] SOLR-5392: Add conf set name to solrj collection create methods git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1537941 13f79535-47bb-0310-9956-ffa450edef68 --- .../apache/solr/cloud/CollectionsAPIDistributedZkTest.java | 4 ++-- .../solr/client/solrj/request/CollectionAdminRequest.java | 6 ++++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/solr/core/src/test/org/apache/solr/cloud/CollectionsAPIDistributedZkTest.java b/solr/core/src/test/org/apache/solr/cloud/CollectionsAPIDistributedZkTest.java index f73b118d672..695923a12e2 100644 --- a/solr/core/src/test/org/apache/solr/cloud/CollectionsAPIDistributedZkTest.java +++ b/solr/core/src/test/org/apache/solr/cloud/CollectionsAPIDistributedZkTest.java @@ -260,7 +260,7 @@ public class CollectionsAPIDistributedZkTest extends AbstractFullDistribZkTestBa } response = CollectionAdminRequest.createCollection("solrj_implicit", - "shardA,shardB", server); + "shardA,shardB", "conf1", server); assertEquals(0, response.getStatus()); assertTrue(response.isSuccess()); coresStatus = response.getCollectionCoresStatus(); @@ -285,7 +285,7 @@ public class CollectionsAPIDistributedZkTest extends AbstractFullDistribZkTestBa nodesStatus = response.getCollectionNodesStatus(); assertEquals(2, nodesStatus.size()); - response = CollectionAdminRequest.createCollection("conf1", 4, server); + response = CollectionAdminRequest.createCollection("conf1", 4, "conf1", server); assertEquals(0, response.getStatus()); assertTrue(response.isSuccess()); diff --git a/solr/solrj/src/java/org/apache/solr/client/solrj/request/CollectionAdminRequest.java b/solr/solrj/src/java/org/apache/solr/client/solrj/request/CollectionAdminRequest.java index 502e4af0c77..c48d73562bd 100644 --- a/solr/solrj/src/java/org/apache/solr/client/solrj/request/CollectionAdminRequest.java +++ b/solr/solrj/src/java/org/apache/solr/client/solrj/request/CollectionAdminRequest.java @@ -297,13 +297,14 @@ public class CollectionAdminRequest extends SolrRequest return req.process( server ); } public static CollectionAdminResponse createCollection( String name, - Integer shards, + Integer shards, String conf, SolrServer server ) throws SolrServerException, IOException { Create req = new Create(); req.setCollectionName(name); req.setRouterName("compositeId"); req.setNumShards(shards); + req.setConfigName(conf); return req.process( server ); } @@ -327,13 +328,14 @@ public class CollectionAdminRequest extends SolrRequest return req.process( server ); } public static CollectionAdminResponse createCollection( String name, - String shards, + String shards, String conf, SolrServer server ) throws SolrServerException, IOException { Create req = new Create(); req.setCollectionName(name); req.setRouterName("implicit"); req.setShards(shards); + req.setConfigName(conf); return req.process( server ); }