* Issue #105 - Mapping changing from custom mapping to dynamic
* when drop_collection = true Should capture the existing
* 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 {
logger.warn("Delete type[{}] on index[{}] return aknowledge false", type, index);