elasticsearch REST API方式批量插入数据

elasticsearch REST API方式批量插入数据

1:ES的服务地址  http://127.0.0.1:9600/_bulk

2:请求的数据体,注意数据的最后一行记得加换行

{ "create": { "_index": "traffic_test", "_type": "traffic_test"} }
{"name": "song40","age":33}
{ "create": { "_index": "traffic_test", "_type": "traffic_test"} }
{"name": "song40","age":33}
{ "create": { "_index": "traffic_test", "_type": "traffic_test"} }
{"name": "song40","age":33}
{ "create": { "_index": "traffic_test", "_type": "traffic_test"} }
{"name": "song40","age":33}

posted @ 2017-06-28 14:24  songpingyi  阅读(6799)  评论(0编辑  收藏  举报