#NEWLINE# @ task #NEWLINE# def alias( alias , index ) : #NEWLINE# #INDENT# ' Creates an Elasticsearch index alias ' #NEWLINE# from scrapi.processing.elasticsearch import DatabaseManager #NEWLINE# dm = DatabaseManager ( ) #NEWLINE# dm . setup ( ) #NEWLINE# dm . es . indices . delete_alias ( index = alias , name = '_all' , ignore = 404 ) #NEWLINE# dm . es . indices . put_alias ( alias , index )