Friday, August 26, 2016

Listing SOLR Collections, Java

Every now and then I need to get the list of collections in a SOLR cloud instance from a Java program. The docs seemed opaque on how to do it, so:

CollectionAdminResponse response = new    CollectionAdminRequest.List().process(server);
ArrayList cols =      (ArrayList)response.getResponse().get("collections");