def recreate_indexes(es=None, indexes=None):
 if (es is None):
  es = get_es()
 if (indexes is None):
  indexes = all_write_indexes()
 for index in indexes:
  delete_index(index)
  es.indices.create(index=index, body={'mappings': get_mappings(index), 'settings': {'analysis': get_analysis()}})
 es.cluster.health(wait_for_status='yellow')

def recreate_indexes ( es = None , indexes = None ) : if ( es is None ) : es = get_es ( ) if ( indexes is None ) : indexes = all_write_indexes ( ) for index in indexes : delete_index ( index ) es . indices . create ( index = index , body = { 'mappings' : get_mappings ( index ) , 'settings' : { 'analysis' : get_analysis ( ) } } ) es . cluster . health ( wait_for_status = 'yellow' )
deletes indexes and recreates them .