#NEWLINE# def reindex( args ) : #NEWLINE# #INDENT# 'Reindex the annotations into a new Elasticsearch index.' #NEWLINE# request = bootstrap ( args ) #NEWLINE# search_config . configure_index ( request . legacy_es , args . target ) #NEWLINE# es_helpers . reindex ( client = request . legacy_es . conn , source_index = request . legacy_es . index , target_index = request . target ) #NEWLINE# if args . update_alias : #NEWLINE# #INDENT# request . legacy_es . conn . indices . update_aliases ( body = { #NEWLINE# #INDENT# 'actions' : [ { #NEWLINE# #INDENT# 'remove' : { #NEWLINE# #INDENT# 'index' : '*' , #NEWLINE# 'alias' : request . legacy_es . index , #NEWLINE# #UNINDENT# } , #NEWLINE# #UNINDENT# } , { #NEWLINE# #INDENT# 'add' : { #NEWLINE# #INDENT# 'index' : args . target , #NEWLINE# 'alias' : request . legacy_es . index , #NEWLINE# #UNINDENT# } , #NEWLINE# #UNINDENT# } ] , #NEWLINE# #UNINDENT# } )