def index_chunk(cls, id_list, reraise=False):
 for ids in chunked(id_list, 80):
  documents = []
  for id_ in ids:
   try:
    documents.append(cls.extract_document(id_))
   except UnindexMeBro:
    cls.unindex(id_)
   except Exception:
    log.exception('Unable to extract/index document (id: %d)', id_)
    if reraise:
     raise
  if documents:
   cls.bulk_index(documents, id_field='id')
  if settings.DEBUG:
   reset_queries()

def index_chunk ( cls , id_list , reraise = False ) : for ids in chunked ( id_list , 80 ) : documents = [ ] for id_ in ids : try : documents . append ( cls . extract_document ( id_ ) ) except UnindexMeBro : cls . unindex ( id_ ) except Exception : log . exception ( 'Unable to extract/index document (id: %d)' , id_ ) if reraise : raise if documents : cls . bulk_index ( documents , id_field = 'id' ) if settings . DEBUG : reset_queries ( )
index a chunk of documents .