Spotlight is the system-wide search service of macOS that continuously indexes files, applications, emails, contacts and their metadata, so that anything on the Mac can be found and opened from a single search field, usually summoned with Command-Space. In macOS it is both a user-facing launcher and a background indexing service that Finder, Mail and other apps rely on.
Introduced with Mac OS X Tiger in 2005, Spotlight changed desktop search from scanning folders at query time to querying a prebuilt index, which returns results almost instantly. Recent macOS versions extended it from search into a command launcher that can run app actions, show clipboard history and perform calculations without opening another app.
How Spotlight builds and queries its index
Spotlight relies on a metadata server process called mds that receives notifications from the file system whenever a file is created or changed. Worker processes named mdworker then open the file, pass it to the matching metadata importer, and store the extracted text and attributes in an index kept in a hidden .Spotlight-V100 folder at the root of each indexed volume.
| Component | Role | Visible to users as |
|---|---|---|
| mds | Coordinates indexing and answers queries | Process in Activity Monitor |
| mdworker | Extracts content from individual files | Short-lived worker processes |
| Metadata importers | Read specific formats such as PDF or Office files | Plug-ins bundled with apps |
| Spotlight index | Stores text and attributes per volume | Hidden folder on each volume |
| Spotlight search window | Accepts queries and shows ranked results | Command-Space search field |
Each file carries metadata attributes such as kMDItemContentType, kMDItemAuthors or kMDItemWhereFroms, which records the download source of a file. Because results come from the index, a search is fast but only as complete as the index; files on excluded or unindexed volumes never appear.
What Spotlight can find and do
Spotlight searches far beyond file names. It looks inside document text, email bodies, calendar events and contacts, and it can answer some questions directly in the results pane.
- Launching apps by typing the first letters of their name.
- Full-text search inside PDFs, Pages, Word and plain-text documents.
- Calculations and unit conversions, such as currency or temperature.
- Dictionary definitions and system settings panes.
- App actions and clipboard history in recent macOS releases, for example creating a note or sending a message from the search field.
- Online suggestions for web results, news and media when Spotlight Suggestions is enabled.
The search window and the Finder search field query the same index. Finder adds a visual query builder, while Spotlight favors quick keyboard-driven access.
Search syntax and command-line tools
Spotlight accepts attribute filters in natural form, which narrow results considerably. They can be combined with Boolean operators written in capital letters.
| Filter | Example | Result |
|---|---|---|
| kind: | kind:pdf invoice | Only PDF files containing the word |
| date: | date:yesterday | Items modified yesterday |
| author: | author:Novak | Documents with that author attribute |
| Boolean operators | budget AND NOT draft | Combines or excludes terms |
| Exact phrase | "quarterly report" | Matches the words in order |
Administrators and power users work with the index through Terminal commands, which expose the same engine for scripts.
| Command | Purpose | Example |
|---|---|---|
mdfind | Searches the index from Terminal | mdfind -onlyin ~/Documents contract |
mdls | Lists the metadata of a file | mdls report.pdf |
mdutil -s | Shows indexing status of a volume | mdutil -s / |
mdutil -E | Erases and rebuilds an index | sudo mdutil -E / |
mdutil -i off | Turns indexing off for a volume | sudo mdutil -i off /Volumes/Archive |
Privacy settings and exclusions
Spotlight settings let users choose which result categories appear and which folders or volumes are excluded from indexing through a privacy list. Excluding a folder removes it from local search results, which is useful for large archives, virtual machine images or developer build folders that generate constant indexing work.
Local indexing stays on the Mac, but Spotlight Suggestions sends search terms and some context to Apple to return online results. Organizations with strict data rules often disable suggestions through a configuration profile while keeping local search, and users can do the same in System Settings.
Indexing scope also depends on the storage. Internal APFS volumes are indexed automatically, external drives usually are as well, while network shares are generally not indexed locally and depend on server-side search support. Time Machine backup destinations keep their own index so that past versions can be searched. Encrypted volumes are indexed only after they are unlocked, and the index is stored inside the protected volume.
Troubleshooting slow or missing results
Most Spotlight problems stem from a damaged or incomplete index, or from heavy indexing activity after a major upgrade or migration. During the first hours after installing a new macOS version, high CPU use by mds_stores is normal.
| Symptom | Likely cause | Fix |
|---|---|---|
| Known files not found | Corrupted index | Rebuild with mdutil -E or the privacy list trick |
| External drive not searchable | Indexing disabled or unsupported format | Enable with mdutil -i on |
| Constant high CPU | Folder with rapidly changing files | Exclude that folder from indexing |
| Old results after deleting files | Index not yet updated | Wait, or rebuild the index |
A simple rebuild method without Terminal is to add the affected volume to the Spotlight privacy list and then remove it again, which forces macOS to discard and recreate the index.
Stripped to the essentials
Spotlight is the search box for your whole Mac. Press Command and the space bar, type a few letters, and it shows matching apps, documents, emails and even quick answers like a calculation.
It works quickly because the Mac keeps a catalog of everything in advance, much like a library card index. Instead of walking through every shelf, Spotlight looks up the catalog and points straight to the right item. When you save or change a file, the catalog is updated quietly in the background, so new documents show up within moments.
Where it is applied
A project manager at an architecture studio needs a supplier contract signed two years ago but cannot remember the file name or folder. Typing kind:pdf Brennan warranty into Spotlight returns the signed contract in under a second, because Spotlight indexed the text inside the scanned and OCR-processed PDF.
The studio’s IT technician notices that several workstations show high CPU use. Running mdutil -s and Activity Monitor reveals that a rendering cache folder rewrites thousands of files per hour. The technician adds that folder to the Spotlight privacy list on every Mac through a configuration profile and disables Spotlight Suggestions according to company policy.
The result is fast, reliable local search for documents and a noticeable drop in background CPU load during rendering work.