Elasticsearch 5.0 批处理文档摄取与管道

Elasticsearch 5.0 batch document ingestion with pipeline

我正在将 elasticsearch 2.1 升级到 5.0。我使用了 2.1 的文档摄取插件,它在批量摄取时效果最好。

对于 5.0,我已经在 5.0 中安装了摄取附件。

我创建了一个管道:

{
  "attachment": {
  "description": "Attachment ingestion",
  "processors": [
    {
      "attachment": {
        "field": "data"
      }
    }]
  }
}

问题是,对于之前的插件,我使用批量摄取,但我在文档中找不到如何在使用管道时进行批量摄取?

你是对的@val,这是一个 rtm 的例子!

return new Promise((resolve, reject) => {
  client.bulk({
    body: documentArray,
    pipeline: 'attachment',//this worked
  }, (error, response) => {
    if (error) {
      return reject(error.message);
    }

    resolve(response);
  });
});