def output_es(es, records, start_record_num, end_record_num, total_records, per_batch):
print("Inserting records %d through %d of %s" % (start_record_num, end_record_num,
(str(total_records) if total_records > 0 else '???')))
num_success, error_list = helpers.bulk(es, records, chunk_size=1000)
if num_success != per_batch:
print("[ERROR] %d of %d inserts succeeded!" % (num_success,per_batch))
print("[ERROR] Errors:")
print error_list
评论列表
文章目录