Boolean Searches in Spotlight


Although some on these pages are not quite so happy with what is arguably Tiger’s strongest user-facing feature, for most, Spotlight has served at least some purpose and will no doubt find more favour in the months to come. And John Siracusa’s epic review of Tiger perhaps best documents the ins and outs of this most useful tool (here). One criticism stands out:

I think Apple has an insultingly low opinion of users’ ability to understand nested boolean logic. They may not know what it’s called, but the concept is intuitively understood. Even my mother has already asked me how to create a Mail rule that requires nested boolean logic: “(from A or from B) and subject contains C.” I had to tell her that it’s not possible. When asked why, I told her that Apple thinks few users need this ability and that it’s potentially confusing. She wasn’t particularly satisfied by that explanation, and neither am I.

The good news is, you can, but it seems to have taken some time to properly traverse the Mac web. First comes this post, which details the boolean OR, and then a few days later this, on the boolean NOT.

The boolean OR
(dog|cat) will find all documents, messages, contacts, etc. containing either the word ‘dog’ or the word ‘cat’. The brackets are evidently optional.

The boolean NOT
dog(-cat) will find all documents with the word ‘dog’ in, but exclude any which contain the word ‘cat’. The brackets here are required.

One might well wonder why Apple couldn’t make this functionality a little more accessible, say by allowing all caps ORs and NOTs in Spotlight queries instead of these rather obscure bracketed syntaxes. There is some suggestion that it is due to boolean searching’s not yet being fully implemented, hence the decision to keep the functionality “hidden”. For those of us that want it in the meantime, this will have to do.



I was able to use the not expression, but or didn’t work I typed
(nightwish|angel) and got absolutely nothing, it seems to be treating it as all one word.


So, will someone now write a widget that does the obscure-to-usable translation?


Thanks so much gareth, I thought it was an obscure key but your right, there it is between delete and return. Thanks so much


Gareth Potter

The pipe? Oooh, bugger. I assume you’re using an American keyboard – both of mine are Japanese, and on there it’s next to the backspace key with the yen symbol.

If I remember correctly, on a UK keyboard, it’s on the same key as (i.e. backslash).

Does this help, or have I missed the boat again? :s

Gareth Potter

Do you mean a boolean AND? Doesn’t Spotlight search all terms by default thus negating the need for a specific AND operator? I’m not sure what you mean otherwise…


I know that i came across the bar used for the and on the web somewhere, but would you mind posting it. Thanks

Comments are closed.