lucene-solr-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Anil <anilk...@gmail.com>
Subject Re: Renaming a collection
Date Sat, 14 May 2016 09:58:16 GMT
Seems solr allows to rename the core only not the collection.

On 14 May 2016 at 15:06, Anil <anilklce@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
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message