侧边栏壁纸
博主头像
落叶人生博主等级

走进秋风,寻找秋天的落叶

  • 累计撰写 130562 篇文章
  • 累计创建 28 个标签
  • 累计收到 9 条评论
标签搜索

目 录CONTENT

文章目录

python脚本重建索引

2023-12-15 星期五 / 0 评论 / 0 点赞 / 123 阅读 / 662 字

转载自:http://blog.csdn.net/zy911016/article/details/52191261平滑重建索引需使用别名,请参考:http://blog.csdn.net/dm_vi

转载自:http://blog.csdn.net/zy911016/article/details/52191261

平滑重建索引需使用别名,请参考:http://blog.csdn.net/dm_vincent/article/details/41643793

python

from elasticsearch import Elasticsearchfrom elasticsearch import helperses_src=Elasticsearch(host_src)   #原索引所在ES集群的hostes_des=Elasticsearch(host_des)   #新索引所在ES集群的hostbody={"query":{"match_all":{}}}  #遍历原索引helpers.reindex(client=es_src,source_index='wechat',target_index='wechat_new',target_client=es_des,query=body,chunk_size=1000) #重建索引 

广告 广告

评论区