您可以使用如下所示的
DeleteByQuery类:
DeleteByQuery deleteAllUserJohn = new DeleteByQuery.Builder("{"user":"john"}") .addIndex("users") .addType("user") .build(); client.execute(deleteAllUserJohn);另请注意,如果您运行的是ES 2.x或更高版本,则需要先从插件安装Delete by query
API。
./bin/plugin install delete-by-query



