Spotlight problems
Rebuilding is the standard advice for every Spotlight problem, and it is the right fix for roughly one problem in three. Here is how to do it properly, and how to tell in advance whether it will help.
Before erasing anything, ask macOS what it thinks:
mdutil -s /
You will get one of three answers. Indexing enabled means the index exists and is being maintained. Indexing disabled means someone turned it off — that is your problem, and rebuilding is not the fix; re-enabling is. No index means there is nothing to search.
For every volume at once:
mdutil -s -a
sudo mdutil -E /
-E erases the existing index and triggers a fresh one. You will be asked for your password. Nothing else is deleted — only the database.
sudo mdutil -E -a
sudo mdutil -i on /
Between about thirty minutes and several hours, depending on the number of files and whether the drive is an SSD. During that window results are incomplete. If you search and find nothing, that may simply be the rebuild talking.
You can watch progress indirectly — the Spotlight menu shows a progress bar while indexing, and mdutil -s / reports status.
Rebuilding is pointless if the file is in one of the places Spotlight excludes by design:
~/LibraryPhotos Library.photoslibrary or an .appNo amount of rebuilding will surface those, because they were never candidates. Check the Privacy list first — it takes ten seconds and it is a surprisingly common cause.
On recent macOS versions, indexing can also be inspected per-volume with:
mdutil -sV /System/Volumes/Data
The Data volume is where your files actually live under APFS, which occasionally matters when the boot volume reports a state that seems inconsistent with what you see.
Yes. It erases the search index only. Your files are untouched and macOS begins rebuilding immediately.
Yes, though search results will be incomplete until it finishes and you may notice some background CPU use.
No. macOS handles that itself. Rebuild only when search is demonstrably wrong.
Everywhere keeps track of every file on your Mac — including the folders Spotlight hides and drives you have unplugged. Free for a day, then $19 once.
Download for Mac