# Querying results from another query

**URL:** https://discuss.elastic.co/t/querying-results-from-another-query/71856
**Category:** Elasticsearch
**Created:** [January 17, 2017, 12:15pm UTC](https://discuss.elastic.co/t/querying-results-from-another-query/71856 "2017-01-17T12:15:48Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![JoeeGrigg](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/joeegrigg/32/4411_2.png) [@JoeeGrigg](https://discuss.elastic.co/u/JoeeGrigg)
#### Post date: [January 17, 2017, 12:15pm UTC](https://discuss.elastic.co/t/querying-results-from-another-query/71856/1 "2017-01-17T12:15:48Z")

</div>

Hi,

I have a bit of a strange situation and from looking online I havent managed to see anything that is obviously the same.

I have a js app that writes a query and then passes it to the backend to actually be executed. This query could change at any time and be an entirely different query from time to time.

I also have another query on the backend that needs to run first.

Is there anyway that I can get the results from one query and then run another query on them results?

Not sure if I have explained it well so if you need more info please ask but any help would be massively appreciated.

Thanks

---

<div class="post-metadata">

### Author: ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)
#### Post date: [February 14, 2017, 12:16pm UTC](https://discuss.elastic.co/t/querying-results-from-another-query/71856/2 "2017-02-14T12:16:10Z")

</div>

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