Left join

I have 3 documents...

{
@id:1,
@type: driver,
name: jos,
surname: hatch,
}

{
@id:2,
@type:driver,
name: elo,
surname: jim,
}

{
@id:444,
@type:car,
color:red,
driver:[1,2]
}

Is it possible in elasticsearch to make a query to obtain this?

{
@id:444,
@type:car,
driver:[{name: jos, surname: hatch,},{name: elo,surname: jim,}],
color:red
}

Elasticsearch does not support joins. It is possible to get limited join-like behaviour through the use of parent-child relationships, but this comes with a number of limitations and can be slow, so it is generally recommended to instead denormalise your data.

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.