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

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

Introduction

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

Prototype

public static CoreAdminResponse unloadCore(String name, boolean deleteIndex, SolrClient client)
            throws SolrServerException, IOException 

Source Link

Usage

From source file:org.opencommercesearch.EmbeddedSearchServer.java

License:Apache License

/**
 * Shutdown the cores for this server, however the coreContainer is left running. This method is intented for the
 * integration testing framework only. Don't use.
 *///from   www  .j ava2s. c o  m
public void shutdownCores() throws SolrServerException, IOException {
    if (isLoggingInfo()) {
        logInfo("Shutting down core for collection " + getCatalogCollection());
        logInfo("Shutting down core for collection " + getRulesCollection());
    }

    boolean deleteIndex = !getInMemoryIndex();
    // @TODO add support to shuutdown all localized cores
    CoreAdminRequest.unloadCore(getCatalogCollection(Locale.ENGLISH), deleteIndex,
            getCatalogSolrServer(Locale.ENGLISH));
    CoreAdminRequest.unloadCore(getRulesCollection(Locale.ENGLISH), deleteIndex,
            getRulesSolrServer(Locale.ENGLISH));
    CoreAdminRequest.unloadCore(getCatalogCollection(Locale.FRENCH), deleteIndex,
            getCatalogSolrServer(Locale.FRENCH));
    CoreAdminRequest.unloadCore(getRulesCollection(Locale.FRENCH), deleteIndex,
            getRulesSolrServer(Locale.FRENCH));
}