一、创建索引
/****
* Setting 相关设置
*/
static final Builder builder = Settings.builder().put("index.analysis.search_analyzer.default.type", "ik_smart")
.put("index.analysis.analyzer.default.type", "ik_max_word").put("index.mapping.total_fields.limit", 30000);
client.admin().indices().prepareCreate(indexName).setSettings(builder).get();
二、删除索引
DeleteIndexResponse response = client.admin().indices().prepareDelete(indexName).execute().actionGet();
三、删除文档
DeleteResponse response = client.prepareDelete("twitter", "tweet", "1").get();