Spotlight search feels instant because almost none of the work happens when you press Cmd+Space. It happens continuously in the background, split across a small set of named processes and command-line tools that most Mac users never see directly: mdworker does the actual indexing, mdimporter plugins know how to read specific file formats, and mdfind and mdutil give you a terminal window into the whole system. If Spotlight search ever stops returning results you know are there, understanding this pipeline is what lets you diagnose and fix it rather than just rebooting and hoping.
mdworker: where the indexing work happens
mdworker is the background process that does the actual work of examining a file and extracting metadata from it. You will typically see one or more mdworker processes in Activity Monitor whenever Spotlight has files queued to process — after a large copy operation, after plugging in an external drive, or after a macOS update that triggers a broader reindex. Each instance picks up files from the queue, hands them to the appropriate importer, and passes the extracted metadata to the index.
Because this work is deliberately backgrounded and resource-throttled, a large indexing job runs for a while without dominating the machine, though it is still real CPU and disk activity, which is why plugging in an old, unindexed external drive can visibly warm up the fans for a few minutes. You can watch this happen directly in Activity Monitor by filtering for mdworker, and if you sort by CPU during a heavy indexing pass you will typically see several instances running at once, each working through a slice of the queued files, rather than a single process ploughing through everything serially.
mdimporter: the plugins that know how to read a file type
mdworker does not itself understand the internal format of a Word document, a photo, or a source code file. That knowledge lives in mdimporter plugins, small bundles that each know how to open one category of file and extract meaningful metadata from it — things like a document's author and word count, a photo's capture date and location, or an email's subject and sender. Apple ships importers for its own formats, and third-party apps can install their own so that Spotlight can index content in formats only that app understands.
This plugin architecture is why installing certain apps can noticeably change what Spotlight is able to find — a new importer teaches the system to look inside a file type it previously could only see by name.
mdfind: querying the index from the terminal
mdfind is the command-line equivalent of the Spotlight search field, letting you query the index directly and script against the results rather than clicking through the UI. It is useful for anyone comfortable in Terminal who wants a fast, repeatable way to search by metadata rather than browsing folders by hand, and it draws on exactly the same index that the graphical search uses — if mdfind cannot find something, neither can Spotlight's UI, which makes it a useful first diagnostic step.
mdimport: testing what an importer actually extracts
mdimport is a different tool with a related name, and it is easy to confuse the two. Where mdfind searches the existing index, mdimport manually runs the import process against a specific file and shows you what metadata gets extracted from it, which is genuinely useful when you are trying to understand why a particular file is not turning up in searches you expect it to match. Running it against a file that should be indexable but isn't showing up in results can reveal whether the importer is extracting the metadata you expected at all.
mdutil: rebuilding a stuck or corrupted index
Sometimes the index for a volume gets into a bad state — searches return stale results, obviously present files do not appear, or indexing seems to be perpetually "in progress" without finishing. The real fix, rather than repeated reboots, is sudo mdutil -E <volume>, which erases the existing index for that volume and triggers a full rebuild from scratch.
sudo mdutil -E /
This is a legitimate and commonly recommended repair step, not a last resort to be avoided. The trade-off is time and load: reindexing a large volume from zero means mdworker has to walk and process every indexable file on it again, which can take a noticeable amount of time and keep CPU usage elevated for a while depending on how much content is on the volume. It is worth doing when Spotlight is genuinely broken, and worth expecting some fan noise and a slower machine for a stretch afterwards.
How this connects to storage, not just search
None of mdworker, the index files it maintains, or .Spotlight-V100 (the folder where the index itself lives at the root of an indexed volume) are typically large contributors to a storage problem compared to things like Xcode's DerivedData or a Docker virtual disk — but the index folder is real, persistent data on disk, rebuilt by exactly the mdutil -E process described above, and it is one of the hidden folders you may encounter when browsing a volume with hidden files visible. Recognising it for what it is means you do not mistake it for something unexplained or unsafe, and it explains why a freshly erased-and-rebuilt index can briefly take up a different amount of space than the one it replaced, before settling once indexing finishes.
Conclusion
Spotlight's apparent simplicity — type a few letters, get instant results — sits on top of a genuinely layered system: mdworker doing the background labour, mdimporter plugins supplying format-specific knowledge, and mdfind, mdimport, and mdutil giving you visibility and control from the terminal when something needs investigating. Knowing which tool does what turns "Spotlight is broken" from a vague complaint into a specific, fixable problem.
We think the same principle applies to storage more broadly: a tool is only as useful as the visibility it gives you into what is actually happening on disk. VolumeLens is built around that idea — showing you real folders, real sizes, and being honest when something could not be read, rather than presenting a tidy summary that hides the mechanism underneath.