# Nested query in elasticsearch

**URL:** <https://discuss.elastic.co/t/nested-query-in-elasticsearch/138843>\
**Category:** Elasticsearch\
**Created:** [July 6, 2018, 7:49am UTC](https://discuss.elastic.co/t/nested-query-in-elasticsearch/138843 "2018-07-06T07:49:53Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Lucky1408](https://avatars.discourse-cdn.com/v4/letter/l/ea5d25/32.png) [@Lucky1408](https://discuss.elastic.co/u/Lucky1408)\
**Post date:** [July 6, 2018, 7:49am UTC](https://discuss.elastic.co/t/nested-query-in-elasticsearch/138843/1 "2018-07-06T07:49:53Z")

</div>

Hi,

for our service we need an nested query. The problem is that iam not so familiar with elasticsearch language and i can only explain my needs in SQL language.

SELECT \* FROM index WHERE attribute IN (SELECT attribute FROM index WHERE key = X)

Is there a chance to realize that in elasticsearch and visualize it in kibana?

Maybe i can do the same with an visualization and a control panel in Kibana -- The first visualization is the outter SELECT and the control panel is the inner SELECT. I have done that already with one problem. In the option panel was more than 400 values and there is no select all option.

I look forward to your answers

---

<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:** [August 3, 2018, 7:49am UTC](https://discuss.elastic.co/t/nested-query-in-elasticsearch/138843/2 "2018-08-03T07:49:54Z")

</div>

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