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?
-
if I use simply should [open, close], it will apply 'or', right?
-
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.
-
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