if (SolrContext.isSingleCoreMode()) {
LOG.debug("In single core mode. There are no cores to swap.");
} else {
LOG.debug("Swapping active cores");
CoreAdminRequest car = new CoreAdminRequest();
car.setCoreName(SolrContext.PRIMARY);
car.setOtherCoreName(SolrContext.REINDEX);
car.setAction(CoreAdminAction.SWAP);
try {
SolrContext.getAdminServer().request(car);
} catch (Exception e) {
LOG.error(e);