ElasticSearch 批量导入json文件中的数据:
命令如下:
curl -H "Content-Type: application/json" -XPOST localhost:9200/people/shakespeare/_bulk?pretty --data-binary @shakespeare_6.0.json
备注:
1、-H "Content-Type: application/json"声明header,
否则会报错 "Content-Type header [application/x-www-form-urlencoded] is not supported
2、_bulk 批量导入
3、--data-binary @shakespeare_6.0.json
shakespeare_6.0.json是json文件