Our thinking


Force Spotlight to rebuild search index on macOS Sonoma and later

I had a Mac recently that was really playing up with Spotlight. So much so that I couldn’t even drag Macintosh HD into the Search Privacy window as it came up with an error – Privacy List Error: The item couldn’t be added or removed because of an unknown error.

What I was able to do to completely reset indexing and force Spotlight to rebuild the search index on all disks was the following:

Open Terminal and type in these commands (you need to be an Administrator user for this to work).

sudo mdutil -ai off
sudo launchctl unload -w /System/Library/LaunchDaemons/com.apple.metadata.mds.plist
sudo rm -rf /System/Volumes/Data/.Spotlight-V100
sudo launchctl load -w /System/Library/LaunchDaemons/com.apple.metadata.mds.plist
sudo mdutil -ai on
sudo mdutil -aE

What this does is turn off search indexing (mdutil -ai off), turns off the Spotlight search process (launchctl unload…), deletes the Spotlight search index, then turns Spotlight back on, reenables search indexing and forces the index process to reindex all volumes.

You’ll then need to wait for some amount of time (maybe half an hour to a couple of hours or more) for the search index to be completely rebuilt.

2 thoughts on “Force Spotlight to rebuild search index on macOS Sonoma and later

Leave a Reply