I am trying to implement multiples indices approach using elasticsearch-dsl. There are basically two steps:
1. Create aliases:
PUT /tweets_1/_alias/tweets_search
PUT /tweets_1/_alias/tweets_index
2. Change alias when necessary:
POST /_aliases
{
"actions": [
{ "add": { "index": "tweets_2", "alias": "tweets_search" }},
{ "remove": { "index": "tweets_1", "alias": "tweets_index" }},
{ "add": { "index": "tweets_2", "alias": "tweets_index" }}
]
}
I could only implement the step 1 using elasticsearch-py (not the dsl):
from elasticsearch.client import IndicesClient
IndicesClient(client).("tweets_1", "tweets_search")
IndicesClient(client).("tweets_1", "tweets_index")
I have no clue how to do that for step 2. So, what would be the equivalent in elasticsearch-dsl (or at least in elasticsearch-py)?