您应该使用Bulk
API。请注意,您将需要在每个json文档之前添加标题行。
$ 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}}]}


