* mapping metadata (in case it is has been customized before to
* delete.
*/
MappingMetaData mapping = mappings.get(type);
if (client.admin().indices().prepareDeleteMapping(index).setType(type).get().isAcknowledged()) {
PutMappingResponse pmr = client.admin().indices().preparePutMapping(index).setType(type)
.setSource(mapping.getSourceAsMap()).get();
if (!pmr.isAcknowledged()) {
logger.error("Failed to put mapping {} / {} / {}.", index, type, mapping.source());
} else {
logger.info("Delete and recreate for index / type [{}] [{}] successfully executed.", index, type);
}
} else {