Wondering how Spotlight works, or why it can’t find a file that you were SO SURE you had saved on your hard drive? Turns out that Spotlight is in essence an index of all the metadata from the files on your hard drive. When you type in a search query, the app searches the index, rather than the actual files on your hard drive. This is what makes it very fast in finding the info you are searching for. Unfortunately, that index itself can get out of date or corrupted, or can be deleted by mistake when restoring a hard drive, for example. Luckily, there are two ways to reindex, or rebuild, Spotlight’s database.
The easiest way to reindex Spotlight is by using the Spotlight preference pane. Simply open System Preferences, click on the Spotlight icon (upper right in the grid), and then click on the Privacy tab. Drag your hard drive or drives from the Desktop to the Privacy window, and then click OK when asked. This tells the computer to exclude the entire disk from Spotlight indexing. Then, and here’s the trick to this whole thing, delete the Hard Drive from the Privacy window by clicking on the minus button in the lower left of the preference pane. Spotlight will think it needs to get indexing again, and will reindex the whole drive or drives you placed there.
Pretty slick, huh?
Spotlight reindexing can take a long time, and your Mac may feel sluggish while it does so, so you might not want to do this during a mission critical task, like finishing up that report for your angry bosses or similar.
- Source OSXDaily