fix
[wolnelektury.git] / apps / search / management / commands / optimizeindex.py
1
2 from django.core.management.base import BaseCommand
3 from search import Index
4
5 class Command(BaseCommand):
6     help = 'Optimize Lucene search index'
7     args = ''
8
9     def handle(self, *args, **opts):
10         index = Index()
11         index.open()
12         try:
13             index.optimize()
14         finally:
15             index.close()