From John Carter If it seems that Spotlight is really slow in giving up a response to a query, it is most likely due to the Mac being clogged up with lots of cache items and other stuff. This can be remedied. There are two ways to get it done.
One way is to download the free tool Onyx for Mac (specific for your version of OS X) and run all the items in the “Cleaning” tab. This is pretty complicated and takes time, but it does one extra thing that is useful and that is to check the status of your internal hard drive before allowing you to do anything else. Well, that can be done with Disk Utilities also, and you should occasionally run the First Aid tab of Disk Utility regardless.
The easier way is to clean up all the caches, launch daemons, launch agents, startup items, and saved application states in your Mac and make Spotlight run like new. To make this really easy, I have created an application that I call CleanMacCache.app (using Automator). All you need to do is download the app from my Dropbox and double-click on it to then clean up your computer to make Spotlight run a lot more efficiently.
Here’s the link to CleanMacCache.app in my Dropbox:
After downloading the app, move it from your Downloads folder to your Applications folder.
When you run that app, Here are the prompts that you will see:
While the application is running, nothing is displayed on the screen. When the operation is complete, you will see this:
If you do nothing, the app will close automatically after one minute.
Just so you know what it does, here are the Terminal command lines that it runs:
rm -rf /library/caches/* rm -rf /library/launchagents/* rm -rf /library/launchdaemons/* rm -rf /library/startupitems/* rm -rf /system/caches/* rm -rf ~/library/caches/* rm -rf ~/library/launchagents/* rm -rf ~/library/saved\ application\ state/*
So if you are curious, you can first look into any one of those folders before and after to convince yourself that it actually did something.
And to put your mind at ease that it is safe to run that app, I got all those instructions from Apple Support when I reported that Spotlight was running extra slow on my computer.
NOTE: This app will ONLY run if your OS X is up to date with El Capitan. Please report any problems to john@jrcarter.com. Thanks.