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.

macOSmacossearchspotlightTerminaldiskDiagnosticsMedium risk
First check the indexing status of your volumes with mdutil -s, then rebuild the index with mdutil -E if it's enabled but broken.

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

?Spotlight shows no results for files that clearly exist, search results are stale or incomplete, or the magnifying glass sits idle while you type. External drives may show up in Finder but return nothing in search.

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.

Command
$ mdutil -s / && mdutil -s /Volumes/ExternalDisk

Erase 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.

Command
$ 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.

Command
$ 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.

Command
$ mdfind -onlyin ~/Documents 'annual report'
mdfind -onlyin /Users/you/Projects 'kMDItemFSName == "*.swift"'
!Rebuilding the index erases the existing Spotlight database; until the rebuild finishes, search results will be incomplete and CPU/disk usage will be elevated. Don't interrupt the process, and be aware that a rebuild on a large drive can take hours.

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 store
    SS64 · technical · 2026-09-17
    Evidence: Documents `-s`: 'Display the indexing status of the listed volumes', with the volume (e.g. / or /Volumes/Name) as the argument.
  • mdutil(1) man page
    Xcode Man Pages (keith.github.io) · technical · 2026-09-17
    Evidence: 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 query
    SS64 · technical · 2026-09-17
    Evidence: Documents mdfind's raw query strings, -onlyin, -name and -live flags.

Last verified: 2026-09-21

Related guides