Why won’t Spotlight index my drive any more?
QSpotlight indexing has stopped working on my Mac’s internal drive. If I remove that drive from under Privacy in Spotlight’s preferences, indexing never completes, and my Mac’s logs are full of repeated errors about mdworker failing. I’ve tried forcing the index to be rebuilt, but the problem recurs. How can I fix this?
AThis usually happens because mdworker, the background service which builds the metadata indexes used by Spotlight, is choking on files or folders that it can’t cope with. Sometimes messages in OS X’s logs reveal which files are causing the problems, so help you work out what to do to eliminate them. They’re usually preference lists (plists) or similar, which can be trashed to allow indexing to work normally.
When there’s no help from your Mac’s logs, use the exclude list in the Privacy tab to work out where offending items are. Remove your internal drive from that list, but add back its top-level folders. Take them out of the list one by one until indexing breaks, and repeat this process to narrow the issue down to one or more individual files.
If you don’t use Spotlight much, you could leave the drive or individual folders that are troublesome excluded. Note, though, that you can’t turn off indexing of your Time Machine backups, as Time Machine relies on Spotlight’s indexes to function.
Clever detective work in Spotlight’s exclusions list can pinpoint items that are getting in the way of indexing.