# Strict terms query (exclusive)

**URL:** <https://discuss.elastic.co/t/strict-terms-query-exclusive/294471>\
**Category:** Elasticsearch\
**Created:** [January 15, 2022, 7:51am UTC](https://discuss.elastic.co/t/strict-terms-query-exclusive/294471 "2022-01-15T07:51:50Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Cholley\_Alexandre](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/cholley_alexandre/32/90867_2.png) [@Cholley\_Alexandre](https://discuss.elastic.co/u/Cholley_Alexandre)\
**Post date:** [January 15, 2022, 7:51am UTC](https://discuss.elastic.co/t/strict-terms-query-exclusive/294471/1 "2022-01-15T07:51:50Z")

</div>

Hi, I am looking to make a terms query but strictly containing specified terms and excluding all docs that do not contain only those terms (eg. docs matches if I have strictly and only A and B =\> no doc matches if I have only A, or only B, or A and B and C, ...). I did not find in terms, terms set, filters, ...  
Thank you in advance for your help 😉

---

<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:** [February 12, 2022, 7:52am UTC](https://discuss.elastic.co/t/strict-terms-query-exclusive/294471/2 "2022-02-12T07:52:31Z")

</div>

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