Rebuild Spotlight Index on Mac OS X

Sometimes after several months Spotlight doesn't work very efficiently and starts to slow down your Mac. Fortunately there's a way to reset the Spotlight Index so that it reindexes your drives which may also lead to a smaller index file size.

Just open Terminal via Spotlight or go to Applications > Utilities > Terminal and copy in the following:

sudo mdutil -E /

This will clear everything from Spotlight and the reindex will start immediately.

If you're having problems (or suspect you're having problems) with a particular drive you can reindex only that drive by using the following command:

sudo mdutil -E /Volumes/[DriveName]

Just replace [DriveName] with the actual path or omit the path; drag and drop the drive from Finder to insert it.

You can exclude drives from Spotlight by going to System Preferences > Spotlight > Privacy.