用java代码删除ElasticSearch索引
public class ElasticsearchDeleteIndexTest {public static void main(String[] args) throws IOException {RestHighLevelClient restHighLevelClient = new RestHighLevelClient(RestClient.builder(new HttpHost("localhost", 9200, "http")));try {DeleteIndexRequest deleteIndexRequest = new DeleteIndexRequest("user");AcknowledgedResponse response = restHighLevelClient.indices().delete(deleteIndexRequest, RequestOptions.DEFAULT);System.out.println(response.isAcknowledged());} catch (Exception e) {e.printStackTrace();} finally {restHighLevelClient.close();}}
}
postman验证删除后就找不到了