elasticsearch REST API方式批量插入数据

时间:2022-10-19 20:22:54

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}