有没有办法在elasticsearch服务器中导入JSON文件(包含100个文档)?我想把一个大的json文件导入es服务器..
有没有办法在elasticsearch服务器中导入JSON文件(包含100个文档)?我想把一个大的json文件导入es服务器..
You should use Bulk API. Note that you will need to add a header line before each json document.
$ cat requests
{ "index" : { "_index" : "test", "_type" : "type1", "_id" : "1" } }
{ "field1" : "value1" }
$ curl -s -XPOST localhost:9200/_bulk --data-binary @requests; echo
{"took":7,"items":[{"create":{"_index":"test","_type":"type1","_id":"1","_version":1,"ok":true}}]}