要实现,您需要使用
elasticsearch-py:
from elasticsearch import Elasticsearches = Elasticsearch()# use es.indices instead of instantiating IndicesClientes.indices.put_alias(index='tweets_1', name='tweets_search')es.indices.put_alias(index='tweets_1', name='tweets_index')es.indices.update_aliases({ "actions": [ { "add": { "index": "tweets_2", "alias": "tweets_search" }}, { "remove": { "index": "tweets_1", "alias": "tweets_index" }}, { "add": { "index": "tweets_2", "alias": "tweets_index" }} ]})


