Spotlight problems
A file is on your Mac. Spotlight says it is not. There are exactly nine common reasons for that, and they are worth knowing in order, because the usual advice — rebuild the index — only fixes the first one.
The most common cause, and the only one the internet's standard advice addresses. macOS keeps a database of your files, and it can fall behind or corrupt itself, particularly after an interrupted update or a forced restart.
Check what macOS thinks about a volume:
mdutil -s /
If it says indexing is disabled, or the status looks wrong, rebuild:
sudo mdutil -E /
That erases the index and starts again. Expect an hour or more of background work on a full drive, and expect search to be unreliable while it runs.
System Settings → Siri & Spotlight → Spotlight Privacy holds a list of places Spotlight is told to ignore. Things end up there by accident surprisingly often — a backup tool added one, or you dragged a folder in years ago and forgot.
~/LibraryYour user Library folder holds application data: Mail messages, Messages history, app support files, container folders for sandboxed apps. macOS hides it from Finder by default, and Spotlight will not return most of what is in it.
This is why an email attachment you know exists cannot be found by name.
An .app, a .photoslibrary, a Logic project, a .pages document — these look like single files but are folders. Spotlight indexes the package, not the contents. Your original photos live inside Photos Library.photoslibrary/originals/, and searching for one by filename returns nothing.
Spotlight's index is per-volume. Unplug an external drive and its records go with it. There is no way to ask Spotlight what was on a disk that is currently in a drawer.
Spotlight relies on importer plugins to read file contents. Unusual formats have no importer, so only the name is searchable, and sometimes not even that.
Spotlight blends filename matches with content matches and ranks them together. A document that merely mentions "invoice" can outrank the file actually called invoice.pdf. In Finder, click the + below the search bar and set Name matches to force filename-only.
Indexing is not instantaneous. A file saved seconds ago may not be searchable yet, which is maddening when you saved it deliberately in order to find it.
Trashed files are dropped from results. Network volumes are indexed only if the server supports it, which many do not.
Spotlight is a content search engine with editorial opinions. It decides what is worth showing you, and those decisions are not configurable. That works well when you half-remember a phrase inside a document, and badly when you know the filename and want the file.
If most of your searches are the second kind, an index that covers everything without exception — including ~/Library, package contents, and volumes that are currently unplugged — solves seven of the nine problems above outright.
On a modern Mac with an SSD, roughly 30 minutes to a few hours depending on how much data you have. It runs in the background and search results will be partial until it finishes.
No. mdutil -E erases only the search index, not your files. macOS rebuilds it automatically afterwards.
Usually the index was rebuilt or partially corrupted in between, or the file moved into an excluded location such as a package or ~/Library.
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