The Database Corruption Vector
Spotlight is the incredibly powerful search engine built directly into the core of macOS. It allows you to find documents, launch applications, and search emails simply by pressing Command + Space. To achieve this speed, Spotlight maintains a massive, hidden database indexing every single file on your hard drive. Occasionally, following a major OS update or a hard crash, this index database becomes corrupted. When this happens, Spotlight will fail to find files you know exist, or the search bar will become completely unresponsive.
How to Rebuild the Spotlight Index
You can force macOS to delete its corrupted database and completely rescan your entire hard drive from scratch.
1. Click the Apple Logo in the top-left corner of the screen.
2. Select System Settings from the dropdown menu.
3. In the left-hand sidebar, click on Siri & Spotlight.
4. Scroll down to the very bottom of the main pane and click the Spotlight Privacy… button.
5. A small dialogue window will appear. Click the plus (+) button in the bottom-left corner of this window.
6. Select your primary hard drive (usually named “Macintosh HD”) from the list and click Choose. This explicitly tells Spotlight to stop indexing your entire computer.
7. Click Done. Spotlight has now purged its database for that drive.
8. Immediately click Spotlight Privacy… again.
9. Select “Macintosh HD” in the list and click the minus (-) button to remove it from the privacy exclusion list.
10. Click Done.
Spotlight will immediately begin rebuilding its index in the background. This process can take several hours depending on the size of your drive, during which time your search results will be temporarily incomplete.