Wednesday, December 12, 2012

Spotlight not working in Mountain Lion

We have received numerous report that in Mountain Lion Spotlight is not searching local HDDs.  Since Outlook also uses Spotlight, no mailbox searching was possible either.

The fix is two-fold.  The first thing to do is delete the index metadata:

sudo /rm ./metadata_never_index

Secondly, re-enable spotlight indexing:

sudo mdutil -a -i on

Technically simply turning Spotlight indexing ON using the mdutil command should resolve the problem.  However we have found that you must first delete the index file first.

Update:  We ran into a computer where the above steps did not resolve the indexing problem.  On that machine the .metadata_never_index file was in the root volume (don't know why).  Removing that file and then running "sudo mdutil -i on /" resolved the problem.
 
1.  Double check that the .metadata_never_index file is not located at the root of the volume you are attempting to index
2.  Disable spotlight indexing for the volume:  sudo mdutil -i off /
3.  Remove the index from the volume:  sudo mdutil -E /
4.  Remove the .Spotlight directory from the root if it exists
5.  If there is a .Spotlight-V100 directory in the root, remove it: sudo rm -rf .Spotlight-V100
6.  Enable indexing for the volume:  sudo mdutil -i on /