这个一直不能用:
for id in data_front: res=es.update(index=index, doc_type=doc_type, id=id, body={"doc": {"flag":0}}) print(id,res) break
{'total': 0, 'successful': 0, 'failed': 0}}
后来改为:"flag":'0',就可以了。
可能是数据类型不对。