How to join 2 index using 2 common values

With transform you can query 2 or more indices and if they have a common field, like an id, you can "join" the results by grouping the common id.

To combine the documents you can use a scripted metric aggregation. It's possible to "collapse" the other documents, which means creating an array of all source documents, or you "join" them, meaning one overwrite the other one. For the later you have to decide the order.

Example post:

1 Like