使用摄入管道分开两个索引
我有包含“状态”字段的文档,这可以具有三个值“草案”,“正在进行”或“批准”。我正在尝试通过摄入的管道将此文档传递,如果状态等于“批准”,则应将其添加到B索引中,而默认情况下,它应在索引中索引,而与状态值无关。 对于前 - 1。
{
"id":"123",
"status":"Draft"
}
{
"id":"1234",
"status":"InProgress"
}
{
"id":"12345",
"status":"Approved"
}
1,2,3文件应转到索引,只有文件3才能转到B索引 是否可以通过摄入管道进行操作?
I have documents containing the field "Status", this can have three values "Draft", "In Progress", or "Approved". I am trying to pass this document through a ingest pipeline, and if the status is equal to "Approved" then it should add it in the B index, whereas by default it should index in A index irrespective of status value.
for ex -
1.
{
"id":"123",
"status":"Draft"
}
{
"id":"1234",
"status":"InProgress"
}
{
"id":"12345",
"status":"Approved"
}
1,2,3 document should go to A Index and only document 3 should go to B Index
Is it possible to do it via Ingest Pipeline?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
在您的摄入管道中,您可以很容易地更改
_index
字段:不值得,但是,您不能将文档发送到两个不同的索引在同一索引中管道,它是
index-a
或index-b
,但不是两者兼而有之。但是,可以通过跨越
index-a
和index-b
的别名来查询这两个索引,从而可以轻松解决这一问题。In your ingest pipeline, you can change the
_index
field very easily like this:It is worth nothing, though, that you cannot send a document to two different indexes within the same pipeline, it's either
index-a
orindex-b
, but not both.However, this can easily be solved by querying both indexes through an alias that spans both
index-a
andindex-b