【发布时间】:2020-07-29 16:15:16
【问题描述】:
我正在使用 elasticsearch 客户端。
var elasticsearch = require('elasticsearch');
var client = new elasticsearch.Client({
host:"https://********",
log: 'trace',
});
可以说我有 JSON 对象
[{"name":"abc", "age": 23},{"name":"bcd", "age": 25}......]
我的目标是批量插入。我试过了,但没用。
client.bulk({
index: "person",
type: '_doc',
body: [{JSON}] // input as JSON format
})
【问题讨论】:
-
这能回答你的问题吗? NodeJs-ElasticSearch Bulk API error handling
标签: node.js elasticsearch elasticsearch-bulk-api