Bool Query - Find all values of "should"

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

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