MacOS – Spotlight constantly indexes MacBook Air (Lion). Takes up 50+% of cpu

activity-monitormacbook promacosspotlight

So I noticed my Air was running very slow. Opened Activity monitor and noticed a process mdworker taking up most of the space. I googled it and it seems to be related to Spotlight.

I opened Spotlight and there appears to be a progress bar along with the message that it is indexing my MacBook Air. I've let this run for ages now but it seems to be stuck at 95%. I tried restarting but I get the same thing. Force quitting mdworker does nothing as it just seems to start again.

Would anyone have any ideas on how to solve this? Thanks!

Best Answer

Try to erase the Spotlight index by either running sudo mdutil -Ea or by temporarily adding your startup disk to the privacy tab in the Spotlight preference pane.

If that doesn't work, try to run:

sudo lsof|grep mdworker

or

sudo mdutil -Ea;opensnoop -n mdworker

to see if the indexing hangs on some specific files.