Looks like no one’s replied in a while. To start the conversation again, simply ask a new question.

Lion Mail and Worthless/Failing Searches

I've been on the beta/GM for a while now but cannot figure out why searching within Mail is generally broken for me.


Problem visualized below in the screenshots. I have a bunch of mail accounts, all of which work nicely. As you can see, there are some emails in view. If I type a full word into the search field, click the "Message contains "Mixpanel" suggestion (which we plainly can see is in the first message listed), I get no results at all. I've tried changing every selectable option I can and nothing will result in actually finding messages.


Searching for partials sometimes works, and choosing the auto suggestions for specific "People" seems to work but not full word searching. I'm stumped.


User uploaded file

User uploaded file

Posted on Jul 21, 2011 8:48 AM

Reply
83 replies

Jul 21, 2011 8:56 AM in response to xmetal280

Have you checked Spotlight in system prefs to make sure that Mail is checked for searching and that Mail is not on the excluded list? My searching Mail in Lion works very well with no issues. I use exclusively IMAP Mail but I opt to have all messages and attachments downloaded for offline reading. This should not be an issue but it may be worth checking your Mail account preferences as well.

Jul 21, 2011 9:02 AM in response to Bradley Olwin

Yes, that was one of the first things I checked. Spotlight works in other respects, Mail is not excluded.


Before upgrading to Lion mail searches worked fine.


I did try the "Rebuild" option available in the Mailbox menu and that had no effect. Also tried purposefully adding the Mail folder into the Spotlight Privacy area and then take it back out to force a reindex but that seemed to do nothing either.

Jul 22, 2011 1:52 PM in response to xmetal280

I had this problem as well, and fixed it by enabling indexing for Spotlight. Here is what you do:


Open Terminal, and type the following: sudo mdutil -i on /


If it asks for your password, type it in and hit return.


It should say "Indexing enabled". You can check to see if Spotlight is indexing your HD by clicking on the Spotlight magnifying glass icon in the top-right of your screen.


If it is not indexing your HD, go to Spotlight's privacy settings in System Preferences and add your Macintosh HD to the list, and then remove it. It should prompt Spotlight to re-index your HD.


Post back here if this helps!

Jul 23, 2011 9:40 AM in response to xmetal280

I ran into the same problem with only some messages (if any at all) showing up in the searches in Mail. For an example, I have over 100 messages from Netflix within all my mail folders (trash included) but when I search for anything containing "netflix" it would only pull up 2 messages from my trash folder on two random dates. This was the case for ANY searches I was trying to pull up, not just for netflix emails.


I spoke to an iOS Senior Advisor who did a screen share with me (because he had never heard of the problem previously) and after reviewing the issue, he said he will be taking this up to the software engineers.


I pointed him to this thread and said I was going to re-index my spotlight (as instructed by John Franks above). I went to System Preferences, then Spotlight, clicked on the Privacy tab, clicked the + to add the entire Macintosh HD to the list of "Prevent spotlight from searching these locations" and then removed the Macintosh HD by clicking the - button. Immediately my spotlight started re-indexing, and it took a good 90 minutes or so. Once it was done, I re-opened Mail and everything worked just fine!


Thanks for the suggestion John!

Jul 24, 2011 3:14 AM in response to thehillisrockin

I had the same issue, tried dumping and rebuilding the entire spotlight index ("sudo mdutil -E /", "sudo mdutil -i on /"). Didn't resolve the issue for me.


I tried manually rebuilding each mail folder via the mail menu item "Mailbox > Rebuild". Also did not resolve the issue for me.


I discovered that for my GMail account I had set "Keep copies of messages for offline viewing" to "Only messages I've read" which was working fine before, but after upgrading to Lion it seems all these locally stored copies were missing or at least no longer being indexed. Two possible solutions here:


* "read" each and every message again -- somewhat lengthy process ;-)

* modify to "All messages, but omit attachments" or "All messages and their attachments" the setting under:

Mail > Preferences; Accounts > my-account-here > Advanced > Keep copies of messages for offline viewing"


THEN select "Mailbox > Rebuild" for each mailbox I'd like to index.


Now all is again indexed.

Jul 26, 2011 5:51 AM in response to xmetal280

To followup, I did the following and it does seem to have helped. Searches are far more accurate now.


- Chnaged preferences on my IMAP accounts to keep messages locally (omitting attachments)

- Put all my hard drives into the 'Privacy' panel for Spotlight, closed the preferences, then opened it back up and took my drives out of the Privacy. Spotlight reindexed everything.


That does seem to work. Tedious and annoying and feels like a bug, but it did work for me. Thanks all.

Jul 27, 2011 7:40 AM in response to henryy

On my Unibody Macbook, upgraded to Lion, the Spotlight Privacy trick works perfectly during the reindexing, but afterward the problem returns immediately.


Interestingly, got my new Macbook Air yesterday and mail search works perfectly. I didn't migrate, I added my email accounts by .Me sync. So perhaps the answer on an upgraded Mac is to let Sync replace all mail accounts? What do y'all think?

Jul 30, 2011 3:32 AM in response to John Franks

Just to add some further background/scenario.


  1. I did not do inline upgrade of Snow Leopard machine I got new Mac with Lion installed.
  2. Did not use Migration Assistant but copied everything over manually (wanted to keep new Lion machine more clean)
  3. Copied over mail folder complete, Lion did some housekeeping and Mail worked fine. Am using new layout.
  4. I have mailboxes that I use to to organise mail by year. So going back to 1999.
  5. I was looking for emails with my Adobe Lightroom serial numbers (I had them filed over multiple (On My Mac) mailboxes. When I did searches for "lightroom" it only found some emails with "light". So I knew it was not working.
  6. Went to System Preferences, Spotlight, Privacy added Macintosh HD, saved, went back and removed it and Spotlight reindexed (magnifying glass had dot in middle). Twenty minutes or so was done.
  7. Now searching works.


One added note about the improved searching in Lion Mail app. When I type "light" Spotlight shows sections in dropdown of: 'Message contains "light"' + People + Subjects + Attachments. When I continue typing to say "lightroom" it narrows down to Message contains "light"' + Subjects. Pretty good.

Lion Mail and Worthless/Failing Searches

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple ID.