Spotlight not indexing on Mac: diagnose and fix it
Find out why Spotlight returns no results — disabled indexing or a corrupted index — and rebuild it from the terminal.
What this covers
When Spotlight stops finding files you know exist, the cause is almost always one of two things: indexing has been switched off for that volume, or the index database has become corrupted. This guide walks you through checking the status, rebuilding the index, and verifying that results are back.
Symptom
Check whether indexing is enabled for your volumes
Before rebuilding anything, confirm Spotlight is actually allowed to index the disk in question. The status query reports 'Indexing enabled', 'Indexing disabled', or that the index is still being built. A 'disabled' status on your system disk or an external drive explains missing results immediately, and 'still building' means you simply need to wait. Run it once for the root volume and once for any external drive that isn't returning results.
Query whether Spotlight indexing is enabled, disabled or still building for the system disk or an external drive.
$ mdutil -s / && mdutil -s /Volumes/ExternalDiskErase and rebuild the Spotlight index
If indexing is enabled but results are stale, empty, or obviously wrong, the index database itself is likely corrupted. Erasing it forces macOS to re-index the drive from scratch. Expect the rebuild to take a while — from minutes on an SSD to hours on a large or spinning drive — and CPU and disk activity will run hot until it finishes. Don't interrupt the process.
Erase the broken Spotlight database so macOS re-indexes your drive from scratch.
$ sudo mdutil -E /Confirm the index returns results via mdfind
Once the rebuild has finished, query the index directly with mdfind instead of the Spotlight UI — it talks to the same index but shows raw results without UI filtering. Run a query for file types you know exist on the disk. If mdfind now returns the files that were previously missing, the index is healthy again.
Use kMDItem attributes to search file metadata the Spotlight UI can't express, faster than find ever will.
$ mdfind 'kMDItemPixelWidth > 4000 && kMDItemContentTypeTree == "public.image"'Spot-check a specific folder that was returning nothing
As a final check, scope a search to the exact directory where results were missing. This confirms that indexing covers not just the volume in general but the specific tree you care about. If the folder still returns nothing while other locations work, check whether that path is excluded from Spotlight's Privacy list in System Settings.
The rarely used -onlyin flag turns mdfind from a whole-system index query into a targeted search inside one directory tree, without the speed cost of find.
$ mdfind -onlyin ~/Documents 'annual report'
mdfind -onlyin /Users/you/Projects 'kMDItemFSName == "*.swift"'How to confirm it worked
After the rebuild completes, run a raw mdfind query for file types you know are on the disk, and optionally scope a search to the specific folder that was failing. Results appearing in both confirms the index is healthy.
Sources
- mdutil - Manage Spotlight indexer storeEvidence: Documents `-s`: 'Display the indexing status of the listed volumes', with the volume (e.g. / or /Volumes/Name) as the argument.
- mdutil(1) man pageEvidence: Man page for mdutil listing the -s flag: show the indexing status of the given volume, including whether it is enabled or disabled.
- macOS mdfind — find files by raw Spotlight queryEvidence: Documents mdfind's raw query strings, -onlyin, -name and -live flags.
Last verified: 2026-09-21
Related guides
A terminal-first walkthrough to find what is holding your external disk open on macOS and eject it safely, from quitting apps to forcing an unmount.
Find out whether your Mac's disk is healthy: check SMART status, rule out a full disk, verify the filesystem, and repair errors from the terminal.
Find out whether macOS detects your external monitor, re-apply a working display mode with displayplacer, and verify the connection is healthy.