//查询指定分页的待删除的数据
List<KnowledgeBase> knowledgeDeletes = knowledgeBaseMapper.selectKnowledgeBasesDelete(date,pageNum,pageSize);
if (CollectionUtils.isNotEmpty(knowledgeDeletes)) {
XxlJobLogger.log("执行es清理数据操作start");
BulkRequest request = new BulkRequest();
for (KnowledgeBase kb : knowledgeDeletes) {
DeleteRequest deleteRequest = new DeleteRequest(esIndexProperties.getKnowledgeBaseIndex(),esIndexProperties.getKnowledgeBase(),kb.getId().toString());
request.add(deleteRequest);
}
client.bulk(request);
XxlJobLogger.log("执行es清理数据操作end");
}