def upload_data(events_df, es_write_index, es_write, uniq_id):
# Uploading info to the new ES
test = events_df.to_dict("index")
docs = []
for i in test.keys():
header = {
"_index": es_write_index,
"_type": "item",
"_id": int(uniq_id),
"_source": test[i]
}
docs.append(header)
uniq_id = uniq_id + 1
print (len(docs))
helpers.bulk(es_write, docs)
items = []
return uniq_id
评论列表
文章目录