'Used in reindex.'

@classmethod
def run_indexing(cls, ids, ES, index=None, **kw):

    sys.stdout.write('Indexing    {0}    {1}\n'.format(len(ids), cls.get_model()._meta.model_name))
    docs = []
    qs = cls.get_model().objects.filter(id__in=ids)
    for obj in qs:
        try:
            docs.append(cls.extract_document(obj.id, obj=obj))
        except Exception as e:
            sys.stdout.write('Failed    to    index    {0}    {1}:    {2}\n'.format(cls.get_model()._meta.model_name, obj.id, e))
    if docs:
        cls.bulk_index(docs, es=ES, index=(index or cls.get_index()))
