def handle(self, *args, **options): es = connections.get_connection() self.stdout.write('Deleting all the indices') es.indices.delete('blog-search') es.indices.create('blog-search', settings.ES_INDICES_SETTINGS) for post in Post.objects.all(): PostES.index_post(post)
def add_card_source(instance, *args, **kwargs): from seed.search.models import PostES PostES.index_post(instance)