Esempio n. 1
0
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)
Esempio n. 2
0
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)
Esempio n. 3
0
 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')
Esempio n. 4
0
 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')