Not Exists OR term match

Hi there,

I have an index where all docs up to yesterday don't have a field called "environment" and all the docs from today onward will have an "environment" field set.

I'd like to write a query that returns all the docs with either the "environment" field missing OR the "environment" field set to a specific value ("live").

I've tried combining the must_not/exist with a term query but I didn't manage to find a solution for it.

Any help?

Thanks

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