# NOT MUST queries

**URL:** <https://discuss.elastic.co/t/not-must-queries/74691>\
**Category:** Elasticsearch\
**Created:** [February 10, 2017, 5:19pm UTC](https://discuss.elastic.co/t/not-must-queries/74691 "2017-02-10T17:19:01Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Alejandro\_Celis](https://avatars.discourse-cdn.com/v4/letter/a/b782af/32.png) [@Alejandro\_Celis](https://discuss.elastic.co/u/Alejandro_Celis)\
**Post date:** [February 10, 2017, 5:19pm UTC](https://discuss.elastic.co/t/not-must-queries/74691/1 "2017-02-10T17:19:01Z")

</div>

Hi... I am new in this amazing toll... and I have the following problem:

I have a set of 1,000,000 customers and they are set as parents of the event "purchase", which contains a list of products customers bought with a property "category".

I want to know which customers have NEVER bought a product with category = "shoes". If I use a MUST NOT in the query I will get all customer that have at least one "purchase" without a product with category = "shoes"... which is not the same thing a "NEVE HAS BOUGHT"

Is there a query that helps me get this info? Like (MUST NEVER HAVE... lol)

Thanks

---

<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 10, 2017, 5:19pm UTC](https://discuss.elastic.co/t/not-must-queries/74691/2 "2017-03-10T17:19:09Z")

</div>

Closed on March 10, 2017, 5:19pm UTC

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