Can we use result from one query as an input to another query in elasticsearch?

It sounds silly and it can be done easily using any programming language using looping , but I was wondering if E.S provides such feature.For example consider this query
SELECT product_name FROM sales WHERE brand_name="sony"
This will give many result ( please consider elasticsearch query equivalent of this query ).Now I want to do something like

foreach ( 'result_from_above_query'" as 'dummy_variable')
SELECT mrp FROM sales WHERE product_name="value_held_by_dummy_variable"

Is it possible using elasticsearch?

Not really. You can do terms lookup from a single doc like this https://www.elastic.co/guide/en/elasticsearch/reference/5.5/query-dsl-terms-query.html#query-dsl-terms-lookup

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