Just have boolean operators and a little tooltip how to write them. Abstraction here isn’t needed. You have to learn the ux anyhow, may as well have the users learn boolean operators so you don’t have to bother with a ux that might end up not being that optimal in the end.