Tuesday 8 July 2014

Spotlight not working?

You just tried to use Spotlight and it found nothing apart from a dictionary word?! Spotlight seems to shut itself down for a variety of reasons  - one being lack of disk space - it seems to need about 5% of your disk space to free to operate effectively. Here's one way to fix it.

Firstly you can check if Spotlight has indeed stopped (from a terminal):
mdutil -s /
If it says: "No index." then you can re-enable it again - making sure you have about 25GB free if you have a 500GB hard drive - you'll need to type in your password as it requires root privileges:
sudo mdutil -i on /
It should say "Indexing enabled" - sometimes you have repeat this last step a couple of times until it says "Indexing enabled".

If you have no joy enabling it you can go one step further and try erasing and rebuilding the Spotlight index:
sudo mdutil -E /

Or as a last resort try removing it manually - firstly you should disable Indexing:
sudo mdutil -i off /
And then remove the index:
rm -rf /.Spotlight-V100
And finally re-enable Indexing:
sudo mdutil -i on /

Once you have enabled Indexing again be prepared to wait for a few hours before it's finished (it'll tell you roughly how long if you click on the Spotlight icon). However you can actually use Spotlight whilst it is building the index - it starts to provide some results fairly soon after it begins indexing.