def handle_recreate_index(request):
 groups = [name.replace('check_', '') for name in request.POST.keys() if name.startswith('check_')]
 indexes = [write_index(group) for group in groups]
 recreate_indexes(indexes=indexes)
 mapping_types_names = [mt.get_mapping_type_name() for mt in get_mapping_types() if (mt.get_index_group() in groups)]
 reindex(mapping_types_names)
 return HttpResponseRedirect(request.path)

def handle_recreate_index ( request ) : groups = [ name . replace ( 'check_' , '' ) for name in request . POST . keys ( ) if name . startswith ( 'check_' ) ] indexes = [ write_index ( group ) for group in groups ] recreate_indexes ( indexes = indexes ) mapping_types_names = [ mt . get_mapping_type_name ( ) for mt in get_mapping_types ( ) if ( mt . get_index_group ( ) in groups ) ] reindex ( mapping_types_names ) return HttpResponseRedirect ( request . path )
deletes an index .