# Select match values from another document in elastic

**URL:** <https://discuss.elastic.co/t/select-match-values-from-another-document-in-elastic/235996>\
**Category:** Elasticsearch\
**Created:** [June 5, 2020, 6:31pm UTC](https://discuss.elastic.co/t/select-match-values-from-another-document-in-elastic/235996 "2020-06-05T18:31:12Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![billy1](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/billy1/32/127235_2.png) [@billy1](https://discuss.elastic.co/u/billy1)\
**Post date:** [June 5, 2020, 6:31pm UTC](https://discuss.elastic.co/t/select-match-values-from-another-document-in-elastic/235996/1 "2020-06-05T18:31:12Z")

</div>

Dears,

how we can convert below sql query to DSL , i have created documents via ELK and i want draw flowchart in kibana

select \* from document1 where field1 value in (select field2 from document2)

Thanks  
salim

---

<div class="post-metadata">

**Author:** ![Christian\_Dahlqvist](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/christian_dahlqvist/32/4617_2.png) [@Christian\_Dahlqvist](https://discuss.elastic.co/u/Christian_Dahlqvist)\
**Post date:** [June 6, 2020, 9:31pm UTC](https://discuss.elastic.co/t/select-match-values-from-another-document-in-elastic/235996/2 "2020-06-06T21:31:35Z")

</div>

That looks like a join, which Elasticsearch does not support. You may need to change how you model your data.

---

<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:** [July 6, 2020, 9:35pm UTC](https://discuss.elastic.co/t/select-match-values-from-another-document-in-elastic/235996/3 "2020-07-06T21:35:05Z")

</div>

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