Skip to content

Instantly share code, notes, and snippets.

@sameek
Created May 2, 2012 12:03
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sameek/2576109 to your computer and use it in GitHub Desktop.
Save sameek/2576109 to your computer and use it in GitHub Desktop.
DeleteIndexType
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