3
我正在嘗試使用elasticsearch-dsl執行multiples indices的方法。基本上有兩個步驟:什麼是Elasticsearch-py等效於別名操作?
1.創建別名:
PUT /tweets_1/_alias/tweets_search
PUT /tweets_1/_alias/tweets_index
2.更改別名必要時:
POST /_aliases
{
"actions": [
{ "add": { "index": "tweets_2", "alias": "tweets_search" }},
{ "remove": { "index": "tweets_1", "alias": "tweets_index" }},
{ "add": { "index": "tweets_2", "alias": "tweets_index" }}
]
}
我只能實現使用elasticsearch-py步驟1(不是dsl):
from elasticsearch.client import IndicesClient
IndicesClient(client).("tweets_1", "tweets_search")
IndicesClient(client).("tweets_1", "tweets_index")
我不知道如何做第2步。那麼,在elasticsearch-dsl(或者至少在elasticsearch-py)中等價呢?