+ def search_index(self, book_info=None):
+ if hasattr(settings, 'CELERY_ALWAYS_EAGER') and settings.CELERY_ALWAYS_EAGER:
+ idx = search.ReusableIndex()
+ else:
+ idx = search.Index()
+
+ idx.open()
+ try:
+ idx.index_book(self, book_info)
+ idx.index_tags()
+ finally:
+ idx.close()
+