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}

转载于:https://www.cnblogs.com/songpingyi/p/7089546.html

你可能感兴趣的:(大数据,c/c++,php)