# Bool Query - Find all values of "should"

**URL:** <https://discuss.elastic.co/t/bool-query-find-all-values-of-should/125917>\
**Category:** Elasticsearch\
**Created:** [March 28, 2018, 11:34am UTC](https://discuss.elastic.co/t/bool-query-find-all-values-of-should/125917 "2018-03-28T11:34:54Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Valter\_Gomes](https://avatars.discourse-cdn.com/v4/letter/v/5e9695/32.png) [@Valter\_Gomes](https://discuss.elastic.co/u/Valter_Gomes)\
**Post date:** [March 28, 2018, 11:34am UTC](https://discuss.elastic.co/t/bool-query-find-all-values-of-should/125917/1 "2018-03-28T11:34:54Z")

</div>

Hello everyone!

I need to create a query which search for a list of values and returns those values only if all values were found.

Otherwise, it should return empty.

For example:

I'm trying to find out if a combination of events happened at that window of time.

Combination I'm looking for [open, close]

List of events [on, on, on, on, open, off, off, close]

How do I now if [open, close] event happened?

1. if I use simply should [open, close], it will apply 'or', right?

2. if I use must it will apply 'and', just like I want. But ES will looking for a document that has the value [open, close] in the same field at same doc.

3. if I use should with "minimum\_should\_match": "100%" , it will behavior like must.

Does someone have any idea about how solve this problem?

Thanks for your support

---

<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:** [April 25, 2018, 11:34am UTC](https://discuss.elastic.co/t/bool-query-find-all-values-of-should/125917/2 "2018-04-25T11:34:56Z")

</div>

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