My brand new Macbook Pro would not show any results when searching in Mail.
This is what happened. In the initial install of Mavericks I was given the opportunity to hook up my TimeMachine backup (created on my old white Macbook). That worked swell: every document and setting was available and all applications were functioning. Except for the search function in Mail (and iCal as well). Searching for items that are definitely present gave ZERO results.
Now, you must know, I upgraded the white Macbook to Mavericks just prior to making the backup. On this old lovely white friend, search was also giving no results after the upgrade to Mavericks.
I did everything that is mentioned in several discussions here: reindexing Spotlight, repairing permissions, deleting and re-installing mail accounts, deleting the Envelope files, etc. Nothing worked for me.
Finally I contacted the Apple service guys. It took me 1 hour chatting and 30 minutes on the phone. They let me do several experiments on the Macbook Pro. None worked. The final conclusion was: reinstall Mavericks. (!!)
I had no confidence but did it anyhow. With great results! Search in Mail and iCal are okay now!
This is what I did:
(Also see http://support.apple.com/kb/PH14243)
1. Boot with CMD-R pressed until you see the apple icon on the grey screen (recovery mode).
2. In the recovery screen, go to Disk Utility. Select the Macintosh HD disk, and press Erase. Exit Disk Utility.
3. In the recovery screen, go to Reinstall OS X.
4. When prompted for a user account, enter "test" or something. NOT the real account name you want. Let installation finish.
You may run Mail just for the fun of it. Enter one of your mail accounts. In my case, Mail search was working okay now.
(For the steps 5 and 6, also see http://support.apple.com/kb/ht4500)
5. In Spotlight, search for "Migration Assistant". Run the program.
6. Hook up your Time Machine backup, and let it restore the 3 options (programs, setups, documents). Choose the option to replace the current account (otherwise it would leave you with account Test and your real account).
After this, you have a fresh reinstallation of Mavericks and all your stuff is available.
In my case, Mail search was not working anymore (BOO). I did the following:
7. Deinstall Gmail account. Remove the entire iCloud settings.
It's a wonder! Mail Search suddenly replied with the searched items (YEAH!!!).
Alas iCal search still didn't find anything :-(. I did the following:
8. Download and install ONYX (donationware, www.titanium.free.fr)
9. Run it, and do the things on the Maintence/Rebuild tab. I kept all the checkboxes untoched, so it rebuilt the mailboxes en the spotlight index. Then, I waited a couple of hours without touching the computer.
That did it for me! I reinstalled the Gmail account and iCloud connection, and everything kept working!
I'M SO HAPPY!!!!