Spotlight doesn't work anymore in OS X Mountain Lion

I can't get Spotlight to search for any documents.

When I search the Finder for documents, nothing happens and the Spotlight search through the menu bar only shows up web searches.


Firsts, make sure you have enough free disk space. How much is enough? Well, if you have 10% of the drive free, it should do.

Open Terminal and execute the following commands one after another:

sudo mdutil -i off /
sudo mdutil -E /
sudo mdutil -i on /

Now Spotline should start indexing your drive. This may take hours but you should get search back after it ends.

Before or after you do that, you can check Spotlight status in Terminal using:

sudo mdutil -sv /

Go to System Preferences. Click on Spotlight. Click on Privacy tab. Click "+" to add a privacy location. Select "Macintosh HD" (or whatever you have named your hard drive).

Wait a few minutes and enter System Preferences again. Go to the Spotlight Privacy tab. Select "Macintosh HD" from the privacy list and remove it.

This is a simple way to force Spotlight to re-index your system.