# How to get results from another results field value

**URL:** https://discuss.elastic.co/t/how-to-get-results-from-another-results-field-value/300014
**Category:** Elasticsearch
**Created:** [March 18, 2022, 8:29am UTC](https://discuss.elastic.co/t/how-to-get-results-from-another-results-field-value/300014 "2022-03-18T08:29:31Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![Shushil\_Shankar](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/shushil_shankar/32/84391_2.png) [@Shushil\_Shankar](https://discuss.elastic.co/u/Shushil_Shankar)
#### Post date: [March 18, 2022, 8:29am UTC](https://discuss.elastic.co/t/how-to-get-results-from-another-results-field-value/300014/1 "2022-03-18T08:29:31Z")

</div>

Hi Everyone,

I need to implement a query when the results are returned, from that I need to take one field value then need to get another result from the field,

![ES](https://us1.discourse-cdn.com/elastic/original/3X/e/3/e301417ca5c22f0fdd562d95d6781e3139f12fc8.png)

From the above screenshot, I got some results based on my query. Here i need to get another results by using ParentAssignmentID value like self join in sql.

Please suggest your thoughts on this.

Thank you!

Shankar

---

<div class="post-metadata">

### Author: ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)
#### Post date: [March 18, 2022, 12:47pm UTC](https://discuss.elastic.co/t/how-to-get-results-from-another-results-field-value/300014/2 "2022-03-18T12:47:46Z")

</div>

You need to send another query then after the first one. You can not really "join" in Elasticsearch.

---

<div class="post-metadata">

### Author: ![Shushil\_Shankar](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/shushil_shankar/32/84391_2.png) [@Shushil\_Shankar](https://discuss.elastic.co/u/Shushil_Shankar)
#### Post date: [March 21, 2022, 10:12am UTC](https://discuss.elastic.co/t/how-to-get-results-from-another-results-field-value/300014/3 "2022-03-21T10:12:11Z")

</div>

Thank you David!

I need to get only 200 records every time depends on the grid length. I need to merge two result at once and get 200 records. But here what happens is getting 200 records at first query after then 20 records from the seconds query and both results are coming from same type. After merging two results it becomes 220 records.. But i need to get only 200 records as per grid length.

Share your thoughts on this.

---

<div class="post-metadata">

### Author: ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)
#### Post date: [March 25, 2022, 7:04am UTC](https://discuss.elastic.co/t/how-to-get-results-from-another-results-field-value/300014/4 "2022-03-25T07:04:41Z")

</div>

May be explain with a more detailed example and we could find if there is another solution?

Could you provide a full recreation script as described in [About the Elasticsearch category](https://discuss.elastic.co/t/about-the-elasticsearch-category/21). It will help to better understand what you are doing. Please, try to keep the example as simple as possible.

A full reproduction script is something anyone can **copy and paste in Kibana dev console** , click on the run button to reproduce your use case. It will help readers to understand, reproduce and if needed fix your problem. It will also most likely help to get a faster answer.

---

<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: [April 22, 2022, 7:05am UTC](https://discuss.elastic.co/t/how-to-get-results-from-another-results-field-value/300014/5 "2022-04-22T07:05:26Z")

</div>

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