lucene-solr-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Anil <anilk...@gmail.com>
Subject Renaming a collection
Date Sat, 14 May 2016 09:36:27 GMT
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