【发布时间】:2017-03-16 17:11:55
【问题描述】:
问题描述
我想使用附件处理器并删除附件数组中的处理器。我知道为此目的需要 foreach 处理器。
这使得附件处理器和移除处理器能够在阵列的各个元素上运行 (https://www.elastic.co/guide/en/elasticsearch/plugins/current/ingest-attachment-with-arrays.html)
我没有找到任何用于索引附件数组和删除内容字段的好的 NEST(c#) 示例。有人可以为我的用例提供 NEST(C#) 示例吗?
更新:感谢 Russ Cam,现在可以使用以下管道索引附件数组并删除 base64 编码的文件内容:
_client.PutPipeline("attachments", p => p
.Description("Document attachments pipeline")
.Processors(pp => pp
.Foreach<ApplicationDto>(fe => fe
.Field(f => f.Attachments)
.Processor(fep => fep
.Attachment<Attachment>(a => a
.Field("_ingest._value._content")
.TargetField("_ingest._value.attachment")
)
)
).Foreach<ApplicationDto>(fe => fe
.Field(f => f.Attachments)
.Processor(fep => fep
.Remove<Attachment>(r => r
.Field("_ingest._value._content")
)
)
)
)
);
【问题讨论】:
标签: elasticsearch nest