What is the Elasticsearch-py equivalent to alias actions?

后端 未结 2 1922
囚心锁ツ
囚心锁ツ 2021-02-13 16:30

I am trying to implement multiples indices approach using elasticsearch-dsl. There are basically two steps:

1. Create aliases:

PUT /twee         


        
2条回答
  •  隐瞒了意图╮
    2021-02-13 16:46

    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
                        }
                    }
                }
            )
    

提交回复
热议问题