@SpringBootTestpublic class MyTest{//注入RestHighLevelClient对象@Autowiredprivate RestHighLevelClient restHighLevelClient;@Testpublic void test() throws IOException {//创建DeleteIndexRequest请求对象,并指定索引库名DeleteIndexRequest deleteIndexRequest = new DeleteIndexRequest(索引库名);//发送请求restHighLevelClient.indices().delete(deleteIndexRequest, RequestOptions.DEFAULT);}}
