(es, index, alias)
This operation assigns the alias to the index and removes the alias
    from any other indices it might be assigned to.
This operation assigns the alias to the index and removes the alias
    from any other indices it might be assigned to.
This operation assigns the alias to the index and removes the alias from any other indices it might be assigned to .
def assume_alias(es, index, alias):
    """
    This operation assigns the alias to the index and removes the alias
    from any other indices it might be assigned to.
    """
    if es.indices.exists_alias(name=alias):
        # this part removes the conflicting aliases
        alias_indices = list(es.indices.get_alias(alias))
        for aliased_index in alias_indices:
            es.indices.delete_alias(aliased_index, alias)
    es.indices.put_alias(index, alias)
def assume_alias ( es , index , alias ) : if es . indices . exists_alias ( name = alias ) : # this part removes the conflicting aliases alias_indices = list ( es . indices . get_alias ( alias ) ) for aliased_index in alias_indices : es . indices . delete_alias ( aliased_index , alias ) es . indices . put_alias ( index , alias )