Spotlight and Apple Mail searches can't find anything anymore - OnyX helps!

When Mac Search and Spotlight have a bug, the daily workflow becomes relatively sluggish.

For a few weeks now I have been beating the problem that my spotlight index keeps going over the Wupper for an indefinite period of time. What sounds so unimportant, however, has a number of painful consequences in everyday life:

  • Spotlight search only shows web hits - even if you search "disk utility" or something like that!
  • normal search function (CMD + F) no longer shows any results
  • Search in Apple Mail first shows too many unsuitable results, then nothing (and suitable results after 3 to 5 minutes)
  • Recent folder is empty
  • The menu item “Open recent” or “Open recent” in any program no longer displays any documents

When all of this no longer works, the first thing you notice is how many areas in macOS access the Spotlight index. And I noticed how often I use these every day.

When Mac Search and Spotlight have a bug, the daily workflow becomes relatively sluggish.
When Mac Search and Spotlight have a bug, the daily workflow becomes relatively sluggish.

Clear Spotlight Index

A few connoisseurs among you will now say that I should delete the Spotlight index completely. Yes i did:

  1. System Settings
  2. Spotlight
  3. Privacy
  4. add the “Macintosh HD” hard drive (or the startup volume) with the plus sign and remove it again immediately

I did it, but it didn't work. The search function then ran for a few hours and everything was gone again.

Delete and recreate Spotlight index files

Since I read while researching this error at some point that you should not only update the Spotlight index (as described above), but really have to delete the corresponding files from the disk, I also did this with a Port-Order done. With the same result: the search function still doesn't want to work any more at some point.

Terminal command for creating a new Spotlight index.
Terminal command for creating a new Spotlight index.

For the sake of completeness, however, here is the procedure:

  1. Port (in the Utilities folder)
  2. Enter command: sudo rm -R .Spotlight-V100 /
  3. Now the Mac wants the admin password
  4. Restart your Mac and check Spotlight search results

Onyx saves Spotlight

The last solution for me is that free Mac tool OnyX came up that has a section that goes by the name "Optimize." These functions allow you to clear many caches and create and build new databases that the Mac uses to manage mail and other data.

After the start, OnyX requires the password of an administrator.
After the start, OnyX requires the password of an administrator.

When you start the OnyX program, it first wants the administrator password so that it can execute appropriate scripts.

Once that's done, go to the "Optimize" tab and select all the options I checked in the screenshot. Then you click on "Run" and give the Mac a few minutes, because it takes a moment for everything to go through.

Many caches and databases can be deleted and restarted via the "Optimize" area in OnyX.
Many caches and databases can be deleted and restarted via the "Optimize" area in OnyX.

When the Mac has restarted, the Spotlight search and the connected areas do their job again. It fixed the problem for me and it hasn't come back for a good three days. So I have high hopes that my Spotlight index will stay functional now!

I can't say which files had to be deleted in order for it to work again, but simply deleting the Spotlight index was not enough. I've tried that several times before.

If you would like to get OnyX, you can find the developer's website here: https://www.titanium-software.fr/en/onyx.html

 

Did you like the article and did the instructions on the blog help you? Then I would be happy if you the blog via a Steady Membership would support.

12 Responses to "Spotlight and Apple Mail search no longer finds anything - OnyX helps!"

  1. Hi, thanks for the detailed explanation. I have the same problem - unfortunately more resistant. My rights are no longer correct either. Deleting the Spotlight index is rejected with 'Operation not permitted'. According to Finder, I am not allowed to write to the hard drive either. Changing the rights also leads to the message that the rights are missing.
    The behavior is also retained with a new admin account, guest account, user account.
    First Aid with Disk Utility shows 'Invalid Request'. If I start the same in install mode, no problems are shown.
    2 months ago I solved the problem with a new installation (reinstallation on a Mac…. Tse).
    This time I shy away from it because a) the backup no longer works and b) the problem seems to be recurring.
    I have no idea….

    1. Hello Ryppo! Wow, that sounds like a tough case. My questions about it:
      1. Have you tried OnyX?
      2. Have you tried the usual things: starting in safe mode, deleting various SMC, PRAM, etc.?
      3. Have you ever tried a start from the rescue partition (hold CMD + R when booting) and then installing the system over it? No data will be lost and maybe something will be repaired?
      4. Last stupid question: what file system does the hard drive have? Hopefully no NTFS or something. : D You never know ...

      Sorry that I wasn't of any help at first, but maybe there are a few ideas what you could try.
      Otherwise I would try to install a new system on an external disk and use the migration assistant to bring the old user data over. Then the system is fresh and as you describe it, the problem is more with the system than with the user data. Otherwise the problem would not be present for all users.

      I keep my fingers crossed and look forward to your feedback, if something happens!

  2. Hi sir,
    yes, I have already done all of these things and carried out them again after your answer. No chance.
    Today I made a USB backup in safe mode. This only worked after manually deleting the local backups.
    Unfortunately, restoring the backup did not help.
    By the way, the system start takes tens of minutes.
    My configuration: MBP 2016 with SSD, macOS Mojave and AFPS. The only specialty is the Win10 partition created by Bootcamp.

    1. Hello Ryppo!
      So with a MacBook Pro from 2016 with SSD, booting shouldn't take longer than 30-60 seconds. There is definitely something wrong. The Bootcamp partition is a separate partition that shouldn't cause macOS any problems. The only thing that could slow down the boot process would be that a startup disk is selected that is not available. So if you have selected your local SSD with the macOS under Startup disk. It should be quick.
      Another idea to find out would be the “verbose mode”. You can get into this if you hold down the CMD + V keys during the restart. Then the Mac throws up a bunch of messages about what it's doing and it's going to get stuck somewhere for quite a while. You should copy this passage. In the lines after the hanger, there is usually an error message that explains what he tried and what didn't work. Here I once had a contribution to it.
      What do you mean by "This only worked after manually deleting the local backups."? What fuses do you mean?
      LG! Jens

  3. Hi Jens,
    yes, the MBP was originally started in a few seconds. The problem just popped up at some point.
    I tried the verbose mode. According to your other article ... yes, I need reading glasses ;-)
    What do you mean by 'copy out'? Can I still access the logs somewhere? The hang only happens when the loading bar and logo appear.
    By 'local backups' I mean the Time Machine (TM) backups. TM creates 5 local backups. I deleted them individually with tmutil. After that it was possible to perform a backup. Only stone-old other TM backups were stored on the USB disk. When using my current backup medium, a Synology Diskstation, I always get the message 'The status of the backup volume could not be queried' since the current problem. This was also the case with the USB disk until the local backups were deleted.
    Best regards,
    Rippo

    1. Hello Rippo! So you can view the verbose mode logs through the Console utility. This shows all possible logs and you can also filter explicitly for problems. Maybe you'll find something there. It would be interesting to see whether booting would take that long even without a Time Machine volume. He's hanging himself somewhere. But where??? By the way, the Synology just had a massive security hole. You should definitely update to the latest version. FYI... LG! Jens

  4. Hi Jens,
    that might be the hint for the next time. In any case, I reserve the contribution to our discussion.
    I gave up for now and went the old “repair” way. The problem was worse again because this way didn't work (reinstall + backup-restore without settings). So the MBP is now in use after the new installation without backup restore. Fast and super as it should be :-)
    Maybe it is really related to the backup. By the way, I didn't delete the backup on Synology. A completely new one has now been created ... and is running.
    Of course, the DSM is always up to date!

    Thank you first and best regards,

    Rippo

    1. Well, sometimes you have to do a clean install. I think it's about time for me too. After 6-7 years of just making upgrades, I'm sure a lot of clutter has accumulated. :D

    1. Hello Robert!

      Thanks you for the tip. I'll test it, but it's working again right now. It usually lasts a day or two and then it's all over again. Even if I rebuild the index with another program or via the data protection entry in the system settings, it works for a few hours to 1-2 days, but eventually nothing can be done again and neither the search in the mail program nor the spotlight search bring any results. I've already mentally resigned myself to the fact that I'll do a clean install again at some point... :-( But if the error occurs again, I'm also happy to try “sudo mdutil -E /”...

  5. Almost 2 years later - OnyX has solved the problem with the Apple Mail search!
    Thank you for the tip, because all the other attempts worked for me.

    Thank you and best regards
    P.

Post a comment

Your e-mail address will not be published. Required fields are marked with * marked

In the Sir Apfelot Blog you will find advice, instructions and reviews on Apple products such as the iPhone, iPad, Apple Watch, AirPods, iMac, Mac Pro, Mac Mini and Mac Studio.