Spotlight is brilliant. It is one of the best pieces of software on your Mac. The spotlight index is a large collection of information a bout every file and folder on your Mac. It contains a wealth of information which allows your Mac to find the exact file you want, even when you don’t enter the most specific file term. The spotlight index, once in a blue moon, can get corrupted. It is worth re-building the index. I have discussed about this before using system preferences, however this tip is about using Terminal.
Rebuild The Index Within Spotlight
Rebuilding the index on your Mac doesn’t take long to implement, however Spotlight itself can take a while to rebuild itself. This is best done overnight, of when you are not using your Mac. You won’t be able to use Spotlight as the index is rebuilt since there will be not data for it to work with.
To rebuild the index open Terminal within your Applications > Utilities folder.
Within Terminal type the following:
sudo mdutil -E /
When you hit enter, it will ask for your password. It will delete the index and begin the re-build. This will effect the root of your Mac, so every file and folder will be deleted. I assume, but haven’t tested the method, that if you put a specific file path after the forward slash it will delete only that part of the index.
After a the spotlight will be rebuilt with fresh data and any duplicates or discrepancies will be cleared.