Use output of one query in as input in another

I would like to use the out of One query as input in another but dont know how.

For example:

Index1: (Field 1, Field 2, Field 3)

Index2: (Field 3, Field 4, Field 5)

Select Field 2 from from Index1 where Field 3 = (select Field 3 from Index 2 where Field 5 = 'user input'))

Basically this goes towards joining two indexes .. and getting the results from two indexes in one query. I am not sure if this is possible in ES.
One easy way would be to merge Index 1 and Index 2 in one but that's not the possibility in the use case as the source are different for both.

1 Like

You cannot currently do this.

Pipeline aggs in 2.0 will let you do some of it though/

Pipeline aggs will not help here unfortunately. Pipeline aggregations let you perform extra computation on the results of an aggregation but do not let you performs joins between results from separate indices.

Ahh bummer :frowning: