Elasticsearch Delete by query using jest [closed]

前提是你 提交于 2019-12-23 22:19:45

问题


I find an interesting feature called delete by query. How do I use it with jest client?

Thanks!


回答1:


You can use the DeleteByQuery class like shown below:

    DeleteByQuery deleteAllUserJohn = new DeleteByQuery.Builder("{\"user\":\"john\"}")
            .addIndex("users")
            .addType("user")
            .build();
    client.execute(deleteAllUserJohn);

Also note that if you're running ES 2.x or above, the Delete by query API needs to be installed from a plugin first.

./bin/plugin install delete-by-query


来源:https://stackoverflow.com/questions/34760557/elasticsearch-delete-by-query-using-jest

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!