python - 有什么方法可以记录 Elasticsearch 7.x 中 delete_by_query 输出删除的 id
问题描述
在 python 中,我对 elasticsearch 库使用 delete_by_query 方法。这绝对很棒,只是我在官方文档中没有看到任何日志记录。那么,如何确保我们作为输入传递的所有 id 都被删除了呢?
现在我只依赖于运行查询前后的计数,但应该有一些我缺少的基本日志记录。有什么线索吗?这可能吗?
代码 :
from elasticsearch import Elasticsearch
es = Elasticsearch([{'host': host,'port': port}],timeout=timeout)
entity_query = {
"query": {
"terms": {
"_id": [] #list_of_ids_here
}
}
}
res = es.delete_by_query(ind_name, query)
print(res)
解决方案
推荐阅读
- git - 带有和不带有“--mirror”的“git clone”的不同提交次数
- snowflake-cloud-data-platform - 在 Azure 存储上使用 ext table + insert 时,Snowflake 复制了错误的数据
- arrays - 为什么当递增接收到数组地址的指针时,其行为与使用该地址初始化的指针不同?
- r - How to save PCA summary?
- tags - 如何制作点击后自动禁用的链接
- reactjs - React JSX:在选中时选择“选中”
- virtual-machine - 如何在 VMWare 快照中保持系统日期和时间不变?
- python - 如何绘制概率密度曲线?
- java - 如何将其放入工作代码中以验证用户输入(Java)?
- c - 如何正确调用仅在 .c 文件中定义的函数?(内核开发)