How to determine when your Spotlight index needs to be rebuilt

SpotlightIconXThe Spotlight index in OS X is the database used for quickly accessing file information on your Mac. While this is primarily used for finding files on your system, there are several other services that use Spotlight’s information, and if there is any damage to Spotlight then you might see odd problems and behaviors dotted throughout your system.

1. Search results not working

The primary indication that Spotlight’s index needs to be rebuilt is if your Spotlight search is not working properly. That is, if you type the first few characters of a file’s name you might see the desired file appear, but if you enter additional characters of the name then the file might disappear from the results list. This indicates the system is not able to properly retrieve search queries from Spotlight’s database.

Spotlight search discrepancy in OS X

In this case, Spotlight shows Calendar as the first result for the search query “calc”.

2. Search not complete

If you have files that you know exist on your system, and regardless of how you search for them they will not show up in Spotlight’s search results, then you likely will need to rebuild your Spotlight index. This same detail goes for the content of smart folders, which are essentially canned Spotlight searches.

3. Search priorities shifted

When you search for documents, Spotlight should learn the ones you prefer from your search, and then give you those as a priority when you next search for the same term; however, if upon searching for the same term you see a different order of your results each time, then you might consider rebuilding Spotlight’s index.

4. Duplicate search results

If you notice any duplicates for the same file showing up in your Spotlight results, and you do not have a local system clone, manual backup, or other intended duplicate of your files available to your system, then you might need to rebuild Spotlight. Note that if you do duplicate many of your files to a single location, then consider adding this drive or folder to Spotlight’s Privacy list so it is not included in your searches.

5. Hard drive space usage calculations incorrect

Finally, when you get information on your Mac from the Apple menu, and use the Storage tab to view the data usage on your hard drives, if these values seem to not agree with the Finder information window’s calculation of your drive usage, or if they seem to jump around rather sporadically, or if they are disproportionate (such as the bar being only one color), then reindexing your drive should fix that.

Spotlight free disk space calculations

Major differences in the space calculations in these two areas indicate problems with Spotlight’s index.

How to reset the Spotlight index

To reset your Mac’s Spotlight index, you can use Terminal-based approaches, but this adds complexity to a relatively easy way to rebuild your Spotlight index, which is to add your entire hard drive to Spotlight’s Privacy list, and then remove it:

  1. Go to the Privacy tab in the Spotlight system preferences
  2. Click the Plus button
  3. Press Shift-Command-C to reveal your hard drives (if they are not available otherwise)
  4. Hold the Command key and click your various drives to add them to your selection
  5. Click the “Choose” button to add them to the Privacy list
Spotlight privacy list in OS X

With your hard drive(s) added to the Privacy list, remove them immediately, and then Spotlight will re-index your drive.

Following this addition, which will have the system remove the Spotlight index from the drives, simply remove the drives from the list, and the system will re-create the Spotlight index on them. Note that doing this will have the system work a little, and you should see the progress of the rebuild in the Spotlight menu, but when finished then these problems and perhaps others that revolve around the Spotlight index should go away.

10 thoughts on “How to determine when your Spotlight index needs to be rebuilt

  1. Chip

    Great timing for this article. For some reason when trying to launch DEVONthink Pro, Spotlight stopped finding the app when I typed ‘dev’ and would only see the app after I typed out the whole name. I reindexed the hard drive and an hour or so later everything is back to normal

  2. Alexander

    I have a Synology NAS and always struggling with searching some files on it. Is it possible to index a NAS Drive with Spotlight?

  3. JB

    I finally gave up on spotlight. It passes all the tests above for its index being current but it just doesn’t work very well.

    For example: I type “somefile.” into spotlight and I can see the file “somefile.c” that I’m looking for. But when I add the “c” so that I’ve typed “somefile.c”, it disappears from the spotlight results. If I try to find the file by typing in a line of text that I know exists in the file, spotlight can’t find it. It’s a waste of my time trying to figure out what it wants.

    My freeware text editor has a much better file search function. It’s slower, but it works.

    1. Antony

      I have to agree…. I am also giving up on Spotlight and the Finder search. Both don’t find things that I know are on my disk! It’s so frustrating. Also, if you search for file contents, preview should take one to highlighted instances within files of the searched for terms, as happens in Windows searches. Why can’t Apple get such basic things right?

      By the way, what is the freeware text editor to which you refer – the one that does reliable searches?

    2. wizbang_fl

      I was having horrid issues with spotlight and knew how to reindex but still had issues and sluggishness. I was provided 2 suggestions which I will pass on. If you use a virtual machine, list the virtual disc in the privacy section, then also select the entire hard disc in privacy. Then power off and then power on the mac (as opposed to reboot) then go to the spotlight and remove only the entire disc from the privacy screen. The VM disc remains as spotlight doesn’t like foreign file systems such as NTFS or FAT32 unless you have acquired a good file system interpreter to allow OS X to read the file system natively. So if you try to use spotlight to index a foreign file system it will hang on those directories as it tries to index files that it doesn’t fully comprehend.

  4. MaX

    Is there a way to prevent Spotlight indexing from scratch (which may take eight hours or more!!!), and instead just update the current index in seconds or minutes?

  5. WD

    Man, thank you! my new mac had decided that runweka.bat was a match for “Bat” than … my old mac had no such problems. Was driving me nuts.

  6. WD

    mmm, unfortunately didn’t work — initially it did, but once all the files were indexed it came back to that weird runweka.bat file (which was on the old machine too). I’ll try training some more, but it feels weird it’s not learning after 3-5 searches even, that should change the ranking probability over the base IR score.

  7. fipplepop

    When I click on COMMAND, SHIFT and C, the screen starts flashing. It says it’s checking, but how long am I supposed to wait? How long is normal? I might add that I stopped waiting after about two minutes in order to type this question.

Comments are closed.