def BulkIndexRecords(self,records):
'''
Bulk Index Records
IN
self: EsHandler
records: a list of records to bulk index
'''
ELASTIC_LOGGER.debug('[starting] Indexing Bulk Records')
success_count,failed_items = es_bulk(
self.esh,
records,
chunk_size=10000,
raise_on_error=False
)
if len(failed_items) > 0:
ELASTIC_LOGGER.error('[PID {}] {} index errors'.format(
os.getpid(),len(failed_items)
))
for failed_item in failed_items:
ELASTIC_LOGGER.error(unicode(failed_item))
ELASTIC_LOGGER.debug('[finished] Indexing Bulk Records')
评论列表
文章目录