其他分享
首页 > 其他分享> > ES删除数据

ES删除数据

作者:互联网

ES删除数据

注意:删除数据请谨慎执行

删除大于**日期的,其他场景可参照执行

DeleteQuery deleteQuery = new DeleteQuery();
        deleteQuery.setIndex("es中_index");
        deleteQuery.setType("es中_type");
        BoolQueryBuilder createDate = QueryBuilders.boolQuery().filter(QueryBuilders.rangeQuery("createDate").gte("data条件"));
        deleteQuery.setQuery(createDate);
        elasticsearchTemplate.delete(deleteQuery);

在这里插入图片描述

参考:
https://blog.csdn.net/xnlej/article/details/80422457?ops_request_misc=%7B%22request%5Fid%22%3A%22158312012319725222445776%22%2C%22scm%22%3A%2220140713.130056874…%22%7D&request_id=158312012319725222445776&biz_id=0&utm_source=distribute.pc_search_result.none-task
https://segmentfault.com/a/1190000017123560

weixin_ab 发布了41 篇原创文章 · 获赞 5 · 访问量 1万+ 私信 关注

标签:删除,22%,DeleteQuery,https,deleteQuery,数据,createDate,ES
来源: https://blog.csdn.net/weixin_43114485/article/details/104612572