转载自: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) #重建索引