Scott writes: For some time now I’ve been trying to figure out why Spotlight won’t find messages based on a few key words within the message body of an email.
For example, say I had an email from my friend and they had put the words “Dinner at 8pm” in the message body. When I search for that exact text Spotlight finds nothing even though I know the message is there. I’ve checked and I definitely have “Mail Messages” selected in my Spotlight System Preference pane.
What can I do?
Well, this is interesting, Scott. Just to test that this should work, I pulled up a Spotlight search for “Dinner at 8pm” and your message came to the top of the list! So it should work.
That said, it sounds like one of two things is happening: either your Mail data folder is being excluded from Spotlight, or the Spotlight cache needs to be rebuilt.
First, go to System Preferences > Spotlight > Privacy and ensure that your [home]/Library/Mail folder isn’t somehow being excluded (it could be the folder itself or anything that contains it, including [home] or your entire hard drive). If it is being excluded, remove it from the list (and know that Spotlight will now re-index and return results from it.
Check Your Spotlight Privacy Settings
If that doesn’t do it, your next step is to rebuild your Spotlight database. Onyx will do this (and while you’re at it, rebuild Mail’s Envelope Index, too), or you can do it from the command line with:
sudo mdutil -E /
Make sure you type the command exactly as it is above. You’ll be asked for your password. Please enter it, and then the process should begin. If you’re curious, this command means:
- sudo: execute as a privileged/root user (this is why you need to type your password)
- mdutil: the command-line utility that manages the Spotlight database
- -E: erase the Spotlight database from whatever path I specify next
- /: The “/” means your “main” hard drive (or the root of the current drive, which on the Mac is always going to be your current boot drive)
Hopefully that helps!