The Spotlight search in your Mac offers a quick way to find files; however, there may be times when even though Spotlight shows search results, it does not update so new files you add to your system are not included. There are several reasons why this may happen, including a damaged Spotlight index, in which case forcing OS X to rebuild your index is the easiest solution; however, there may be instances where even upon rebuilding, you only get a small subset of expected files in a search result.
If this happens, then it suggests Spotlight is unable to build the Spotlight database in full, and the main reason for this is faulty plug-ins being used for Spotlight. While Spotlight will by default scour your drive for the metadata associated with files (general information bits like its size, owner, type, name, etc.), it also can index file content so you can search within them. Spotlight has the ability to read many common file types, but in order to augment Spotlight search for custom file formats, developers can create a plugin that will allow reading and indexing of otherwise unavailable content in documents.
Spotlight plugins are files that end in the .mdimporter extension, and are located in the following directories:
Macintosh HD > System > Library > Spotlight
Macintosh HD > Library > Spotlight
Macintosh HD > Users > username > Library > Spotlight
The first folder mentioned above has all of the Spotlight plugins that Apple includes in OS X, for handling common file types like audio, PDFs, text files, and formats for Apple’s programs like iPhoto libraries. The plugins in this folder should include only the following:
This is a system folder, so its contents should not be changed by any third-party program, and removing any of its files will restrict OS X’s default Spotlight abilities, so it is highly recommended to leave this folder alone. If in using the Console utility to investigate system logs, you see errors that have you suspecting one of the plugins in this folder, then your best bet is to perform a reinstall of OS X or otherwise look into the conflict, rather than remove any of these files.
Beyond the system folder, the mdimporter files in the other two directories are fair game for troubleshooting. These may include plugins for Office documents, Apple’s iWork suite, and similar applications. As a broad first step, try removing all plugins from these directories and place them in a location like your Desktop. Then force Spotlight to re-index your drive using the following procedure:
- Go to the Privacy tab in the Spotlight system preferences
- Drag your hard drive to the list
- Remove your drive from the list
When done, Spotlight will re-index, which may take a while to complete, but when done you can see whether or not indexing was complete and Spotlight searches include your expected files. If so, then you can add your plugins back to their original directories one at a time, and then repeat this process to see if you can identify the one that is causing the problem.