Example usage for org.apache.solr.client.solrj.request CoreAdminRequest getCoreStatus

List of usage examples for org.apache.solr.client.solrj.request CoreAdminRequest getCoreStatus

Introduction

In this page you can find the example usage for org.apache.solr.client.solrj.request CoreAdminRequest getCoreStatus.

Prototype

public static CoreStatus getCoreStatus(String coreName, SolrClient client)
            throws SolrServerException, IOException 

Source Link

Usage

From source file:org.opencb.commons.datastore.solr.SolrManager.java

License:Apache License

/**
 * Check if a given core exists./*  ww  w .  ja  v  a  2 s  .  c  o  m*/
 *
 * @param coreName Core name
 * @return True or false
 */
public boolean existsCore(String coreName) {
    try {
        CoreStatus status = CoreAdminRequest.getCoreStatus(coreName, solrClient);
        status.getInstanceDirectory();
    } catch (Exception e) {
        return false;
    }
    return true;
}