Created
May 2, 2012 12:03
-
-
Save sameek/2576109 to your computer and use it in GitHub Desktop.
DeleteIndexType
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public boolean deleteIndexType(Client client, String indexName, String indexType) { | |
boolean deleteIndexTypeStatus = false; | |
boolean indexTypeExist = checkIndexTypeExistance.isIndexTypeExist(client, indexName, indexType); | |
logger.debug("index Type Existence found>>" + indexTypeExist); | |
if (indexTypeExist) { | |
DeleteMappingResponse actionGet = client.admin().indices().prepareDeleteMapping(indexName).setType(indexType).execute().actionGet(); | |
RefreshRequestBuilder prepareRefresh = client.admin().indices().prepareRefresh(indexName); | |
RefreshResponse refreshActionGet = prepareRefresh.execute().actionGet(); | |
logger.debug("Index Type Mapping deleted sucessfully-" + refreshActionGet); | |
deleteIndexTypeStatus = true; | |
} | |
return deleteIndexTypeStatus; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment