for form_item in forms.files:
logger.info("form_item: %s", form_item)
temp = property_file_upload_esbody(task_id, user, form_item)
insert_es.append(temp)
if len(insert_es) > 200:
bulk(es_client, insert_es, index=conf['ES_INDEX'], raise_on_error=True, refresh=True)
insert_es *= 0
if insert_es: # refresh=True实时插入,否则要等es写入的时间,会造成页面立即刷新无数据
bulk(es_client, insert_es, index=conf['ES_INDEX'], raise_on_error=True, refresh=True)
python es批量插入数据
最新推荐文章于 2024-02-27 17:50:27 发布