带有摄取插件的ElasticSearch Bulk

时间:2017-07-26 16:09:17

标签: elasticsearch bulkinsert elasticsearch-plugin

我在管道中使用附件处理器Attachment Processor

一切正常,但我想做多个帖子,然后我尝试使用bulk API。 批量工作也很好,但我找不到如何发送url参数“pipeline = attachment”。

此放置有效:

POST testindex/type1/1?pipeline=attachment
{
  "data": "Y291Y291",
  "name" : "Marc",
  "age" : 23
}

这批量工作:

POST _bulk
{ "index" : { "_index" : "testindex", "_type" : "type1", "_id" : "2" } }
{ "name" : "jean", "age" : 22 }

但是如何通过管道插件来理解Marc的批量数据字段?

1 个答案:

答案 0 :(得分:1)

感谢Val的评论,我做到了,它运作良好:

POST _bulk
{ "index" : { "_index" : "testindex", "_type" : "type1", "_id" : "2", "pipeline": "attachment"} } }
{"data": "Y291Y291", "name" : "jean", "age" : 22}