Hi Anil. You may want to look at collection alias https://cwiki.apache.org/confluence/display/solr/Collections+API#CollectionsAPI-api4
When using alias, the name of the underlying collection should not really matter. Thanks. On 14 May 2016 at 10:58, Anil <anilk...@gmail.com> wrote: > Seems solr allows to rename the core only not the collection. > > On 14 May 2016 at 15:06, Anil <anilk...@gmail.com> wrote: > > > HI, > > > > Can we rename the collection ? > > > > if yes, action=rename with request path /admin/cores works ? Please > > clarify. > > > > i tried following code.. but no luck. > > > > CloudSolrServer cloudSolrServer = new > > CloudSolrServer("localhost:2181/solr"); > > cloudSolrServer.setDefaultCollection("test-collection-2010"); > > ModifiableSolrParams modParams = new ModifiableSolrParams(); > > modParams.set(CoreAdminParams.ACTION, > > CoreAdminParams.CoreAdminAction.RENAME.name()); > > > > // for (int i = 2010; i<= 2010; i++){ > > modParams.set(CoreAdminParams.CORE, "test-collection-2010"); > > modParams.set(CoreAdminParams.OTHER, "test-collection-new-2010"); > > try { > > QueryRequest request = new QueryRequest(modParams); > > request.setPath("/admin/cores"); > > System.out.println(request.toString()); > > NamedList<Object> response = cloudSolrServer.request(request); > > System.out.println("collection rename of 2010 is completed"); > > }catch(Exception ex){ > > System.out.println("collection rename of 2010 is failed"); > > ex.printStackTrace(); > > } > > // } > > > > Thanks, > > Anil > > > -- Arcadius Ahouansou Menelic Ltd | Applied Knowledge Is Power Office : +441444702101 Mobile: +447908761999 Web: www.menelic.com ---