What is the Elasticsearch-py equivalent to alias actions? What is the Elasticsearch-py equivalent to alias actions? elasticsearch elasticsearch

What is the Elasticsearch-py equivalent to alias actions?


To implement that you need to use 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"  }}    ]})


index_list_for_realias = [...]aliases_list_to_realias = [...]for i in index_list_for_realias:    print(i)    for j in aliases_list_to_realias:        es.indices.put_alias(index=i, name="logstash5-uni-" + j, body={                "filter": {                    "term": {                        "uni": j                    }                }            }        )