您可以使用DeleteByQuery class https://github.com/searchbox-io/Jest/blob/eb2d90d0504a6e3db874cc8bd14efe4913451173/jest-common/src/main/java/io/searchbox/core/DeleteByQuery.java如下图所示:
DeleteByQuery deleteAllUserJohn = new DeleteByQuery.Builder("{\"user\":\"john\"}")
.addIndex("users")
.addType("user")
.build();
client.execute(deleteAllUserJohn);
另请注意,如果您运行的是 ES 2.x 或更高版本,通过查询API删除 https://www.elastic.co/guide/en/elasticsearch/reference/2.0/breaking_20_removed_features.html#_delete_by_query_is_now_a_plugin需要先从插件安装。