# Get subset of values that exist for a given search

**URL:** <https://discuss.elastic.co/t/get-subset-of-values-that-exist-for-a-given-search/263523>\
**Category:** Elasticsearch\
**Created:** [February 7, 2021, 2:25pm UTC](https://discuss.elastic.co/t/get-subset-of-values-that-exist-for-a-given-search/263523 "2021-02-07T14:25:20Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![cozzbp](https://avatars.discourse-cdn.com/v4/letter/c/a698b9/32.png) [@cozzbp](https://discuss.elastic.co/u/cozzbp)\
**Post date:** [February 7, 2021, 2:25pm UTC](https://discuss.elastic.co/t/get-subset-of-values-that-exist-for-a-given-search/263523/1 "2021-02-07T14:25:20Z")

</div>

Is it possible to query for which values of a given set are represented/not represented in the data set? If I have documents that look like:

```auto
    {
      "category": "fiction",
      "tags": ["horror", "thriller"]
    }

```

And I want to query to see which of the following tag values exist for the "fiction" category?

```auto
    [
      "fiction",
      "thriller",
      "romance",
      "sci-fi",
      "action",
      "adventure
    ]

```

---

<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:** [March 7, 2021, 2:26pm UTC](https://discuss.elastic.co/t/get-subset-of-values-that-exist-for-a-given-search/263523/2 "2021-03-07T14:26:12Z")

</div>

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