How to rebuild the Spotlight index

high sierraspotlight

  • Apple Mac Pro (early 2009)
  • Firmware 4.1 -> 5.1
  • macOS 10.13.6 beta
  • Alfred 3.6.1

Due to problems with Alfred, I am trying to rebuild my Spotlight index.
I've been advised the following commands should work:

launchctl unload -w /System/Library/LaunchDaemons/com.apple.metadata.mds.plist
launchctl   load -w /System/Library/LaunchDaemons/com.apple.metadata.mds.plist

sudo mdutil -E -i on /

The last command results in the error message:
Spotlight server is disabled.

Does anyone have any idea how to solve this?

Best Answer

I just fixed my Spotlight index issue a couple days ago with the following commands. Was driving me nuts too.

cd /
sudo mdutil -E /
sudo mdutil -a -i off
sudo rm -fr .Spotlight-V100/
sudo mdutil -i on /Volumes/Macintosh\ HD

For MacOS 10.15 Catalina and beyond, the last two lines should be:

sudo rm -fr /System/Volumes/Data/.Spotlight-V100/
sudo mdutil -i on /System/Volumes/Data

I know you tried something similar with Monomeeth guidance but maybe the subtle difference will work for you.

I added the actual Volume directory and Name to the last command since I had some USB drives plugged in that would get indexed otherwise.

I used Alfred for a while too but was happier with Quicksilver so I switched back.

Noticed you are running macOS 10.13.6 beta. Any chance that could be causing an issue? I would have put this as a comment but I don't have the rep yet. :-(