How to Force Spotlight to Reindex A Volume

If you use Apple hardware and run OS X, you may encounter a mildly annoying Spotlight issue from time to time where it will not find a file, or an app.

To correct this issue, there are two things you can try. The first is described in this post ( by Apple. They tell you to use System Preferences > Spotlight > Privacy (tab). If you drag a folder or hard drive to the Privacy tab, then remove it from there, Spotlight will reindex that item. Sometimes this works.

The second option, which gives you a lot more control, is to fire up the trusty command line found in Applications > Utilities > Terminal and run a couple of commands. The command in question is:

sudo mdutil -E

The -E flag forces Spotlight to erase (hence E) the indicated volume information. If you want to be more specific, such as a folder with your writing in it, or your Applications, you can tailor mdutil as follows:

sudo mdutil -E /volume/path/to/folder

As with all things run in the terminal, when they work, there is no feedback. You just end up back at the command prompt wondering what's up.

For more information on the mdutil functions, you can hit up the Apple Developer documents on mdutil

Note: This is advice on the internet, use at your own risk.

to blog