# Exact Match Term Query Filter

**URL:** <https://discuss.elastic.co/t/exact-match-term-query-filter/291123>\
**Category:** Elasticsearch\
**Created:** [December 7, 2021, 1:29pm UTC](https://discuss.elastic.co/t/exact-match-term-query-filter/291123 "2021-12-07T13:29:09Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Lockhead](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/lockhead/32/46631_2.png) [@Lockhead](https://discuss.elastic.co/u/Lockhead)\
**Post date:** [December 7, 2021, 1:29pm UTC](https://discuss.elastic.co/t/exact-match-term-query-filter/291123/1 "2021-12-07T13:29:09Z")

</div>

I have a Keyword field, which can contain multiple values, is there a way to query only for documents that contain "only" a specific Keyword?

Let's imagine I have an Index with the following 4 documents:

```auto
{"tags": "a"}
{"tags": ["a", "b"]}
{"tags": "b"}
{"tags": ["a", "c"]}

```

I'm looking for a filter query, that would only provide the first document, with "tags":"a", but not the second or forth as they also contain "b" and "c". And the culprit is now that I don't know what other Keywords could be there. So I need to filter for something like:

GIVE ME ALL DOCUMENTS THAT ONLY HAVE THE TAG "A"

---

<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:** [January 4, 2022, 1:29pm UTC](https://discuss.elastic.co/t/exact-match-term-query-filter/291123/2 "2022-01-04T13:29:37Z")

</div>

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