0

https://developer.apple.com/library/mac/documentation/Carbon/Conceptual/SpotlightQuery/Concepts/QueryFormat.html

Apple's dev dox provide info for File Metadata Query Expression Syntax.

The problem I'm having is that I want to do 'A and not(B or C)' but I don't see how to do it. It seems I can only do 'A and ((not B) or (not C))' and that's not what I want. There's a nice truth table generator here that demonstrates the problem: http://turner.faculty.swau.edu/mathematics/materialslibrary/truth/

I'm thinking that it's not possible given what Spotlight supports, per the dox.

SOLVED

Some details on the problem I'm trying to solve: I want to see email to me from outside the company domain AND not webex generated (it is used for meeting updates, etc.) MS Outlook 2011 (Mac) uses OS X Spotlight search engine to filter email with a 'Raw Query'.

The working query (thanks, Renzo) is:

com_microsoft_outlook_recpient_email_addresses == "jsmith@example.com" && com_microsoft_outlook_author_email_addresses != "*@example.com" && com_microsoft_outlook_author_email_addresses != "*@webex.com"

1 Answers1

0

According to the “De Morgan's laws” the expression A and not(B or C) is equal to A and not(B) and not(C), so you can use the && operator and the != operator to express your condition.

Renzo
  • 26,848
  • 5
  • 49
  • 61
  • Aha! I should have stayed in school — that did it and it works perfectly! I used this for the 'Raw Query' in MS Outlook 2011 (Mac) that utilizes the OS X Spotlight search engine. The problem was: I want to see email to me from outside the company domain AND not webex generated (it is used for meeting updates, etc.) The working query is: com_microsoft_outlook_recpient_email_addresses == "jsmith@example.com" && com_microsoft_outlook_author_email_addresses != "*@example.com" && com_microsoft_outlook_author_email_addresses != "*@webex.com" – Joe Chapman Jul 24 '15 at 18:11
  • Glad to have helped you. – Renzo Jul 24 '15 at 19:03