Guys,
Actually, the feature you're asking for is coming in 7.5 via the new enrich processor, which kind of provides index-time JOIN capability.
The main idea is to set up an enrich policy that will source data from your related indexes into a new "enrich index" and then you can leverage that "enrich index" in your ingest pipeline using an enrich processor in order to enrich your documents with related fields.
So, without going in too many details, here is how it works in practice:
- You have an index
Awith fields (a,b,c,d) that you'd like to use for enriching your incoming documents - You define an enrich policy based on that index
Aand the "join" fielda - You define an ingest pipeline with an enrich processor that will try to match field
zof the incoming document against fieldA.aof the enrich index - If a match is found, your incoming document will get fields
b,canddfrom the indexA. Note that it will also get the match fieldathat you can remove using aremoveprocessor if needed.
That should pretty much work the way you expect. You can find a complete example here. At the beginning, it will work for exact matches (i.e. term query) and geo matches (i.e. geo_shape query), but they will probably add new kind of matches (like range matches) in the near future.