def handle_recreate_index(request): """Deletes an index, recreates it, and reindexes it.""" 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_with_scoreboard(mapping_types_names) return HttpResponseRedirect(request.path)
def handle_recreate_index(request): """Deletes an index, recreates it, and reindexes it.""" 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 setup_indexes(self, empty=False, wait=True): """(Re-)create write index""" from kitsune.search.es_utils import recreate_indexes recreate_indexes() get_es().cluster.health(wait_for_status='yellow')