예제 #1
0
파일: reindex.py 프로젝트: psbots/kuma
 def handle(self, *args, **options):
     logging.basicConfig(level=logging.INFO)
     percent = options['percent']
     mappingtypes = options['mappingtypes']
     if not 1 <= percent <= 100:
         raise CommandError('percent should be between 1 and 100')
     es_reindex_cmd(percent, mappingtypes, options['chunk_size'])
예제 #2
0
파일: reindex.py 프로젝트: AprilMorone/kuma
 def handle(self, *args, **options):
     logging.basicConfig(level=logging.INFO)
     percent = options['percent']
     mappingtypes = options['mappingtypes']
     if not 1 <= percent <= 100:
         raise CommandError('percent should be between 1 and 100')
     es_reindex_cmd(percent, mappingtypes)
예제 #3
0
    def setup_indexes(self, empty=False, wait=True):
        """(Re-)create ES indexes."""
        from search.index import es_reindex_cmd

        if empty:
            # Removes the index and creates a new one with nothing in
            # it (by abusing the percent argument).
            es_reindex_cmd(percent=0)
        else:
            # Removes the index, creates a new one, and indexes
            # existing data into it.
            es_reindex_cmd()

        self.refresh()
        if wait:
            get_indexing_es().health(wait_for_status='yellow')
예제 #4
0
파일: __init__.py 프로젝트: gerv/kuma
    def setup_indexes(self, empty=False, wait=True):
        """(Re-)create ES indexes."""
        from search.index import es_reindex_cmd

        if empty:
            # Removes the index and creates a new one with nothing in
            # it (by abusing the percent argument).
            es_reindex_cmd(percent=0)
        else:
            # Removes the index, creates a new one, and indexes
            # existing data into it.
            es_reindex_cmd()

        self.refresh()
        if wait:
            get_indexing_es().health(wait_for_status='yellow')