patt/management/commands/rebuild_index.py

10 lines
320 B
Python
Raw Normal View History

2020-01-26 21:04:45 +01:00
from django.core.management.base import BaseCommand
from patt.search import create_index, rebuild_index
class Command(BaseCommand):
def handle(self, *args, **options):
ix = create_index()
n = rebuild_index(ix)
self.stdout.write(self.style.SUCCESS('Search index for %d items created.') % n)