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.


Comments have been disabled for this post