es 批量添加数据

指令:

curl 172.17.1.15:9200/_bulk?pretty --data-binary @E:BinDebug estdata437714060.json

json文件的内容定义

{"index":{"_index":"meterdata","_type":"autoData"}}
{"Mfid ":1,"TData":172170,"TMoney":209,"HTime":"2016-05-17T08:03:00"}
{"index":{"_index":"meterdata","_type":"autoData"}}
{"Mfid ":1,"TData":172170,"TMoney":209,"HTime":"2016-05-17T08:03:00"}

第一行指定index和type,并且要是单独一行,第二行指定json字符串的内容,最后要有新行单独换行,否则最后一条记录就插入失败

原文地址:https://www.cnblogs.com/suntp/p/9073201.html