[英]ElasticSearch - Delete an Index using Java HighLevel HTTP Client
Previously using ElasticSearch Transport API, I have deleted an index and its data using the below line of program. 以前使用ElasticSearch Transport API,我已使用下面的程序行删除了索引及其数据。
DeleteByQueryAction.INSTANCE.newRequestBuilder(client).source(indexName).get();
We are migrated from Transport Client API to HTTP Client API now. 现在,我们已从传输客户端API迁移到HTTP客户端API。 Unfortunately this is not supported in ES HighLevel HTTP client API as for as I know.
不幸的是,据我所知,ES HighLevel HTTP客户端API不支持此功能。 Is there a way to delete an index using HTTP client?
有没有一种使用HTTP客户端删除索引的方法?
Edited: I am using ES Rest client API version 5.6.4. 编辑:我正在使用ES Rest客户端API版本5.6.4。 Deleting an index is available in the latest 6.x versions.
最新的6.x版本提供删除索引的功能。 I am looking for deleting the index in version 5.6.4.
我正在寻找删除5.6.4版中的索引。 Thanks
谢谢
Then I suggest simply making a DELETE call on your index using the low-level REST API, that'd do the trick 然后,我建议您仅使用低级REST API对索引进行DELETE调用即可,
Response response = restClient.performRequest("DELETE", "/" + indexName);
Note that you don't need to use the Delete by query API for deleting an index. 请注意,您不需要使用Delete by查询API来删除索引。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.