The best way to disable or enable Spotlight search in Mac OS X Lion, OS X Mountain Lion, OS X Mavericks and OS X Yosemite is by using Terminal. If you want to disable Spotlight search on OS X 10.4 and 10.5, read this guide . A main reason Apple users want to disable Spotlight search is because of mdworker, the software running Spotlight. The following will allow you to either enable or disable Spotlight on your Mac computer.
var ARTICLE_URL = window.location.href;
var CONTENT_ID = 'everything';
Open up the Terminal (found in /Applications/Utilities/) and enter the following commands based on the need to either disable or reenable Spotlight indexing. This will effect indexing on all drives connected to the Mac.
For those interested in getting the most out of your Mac computer, then make sure to check out Apple’s wireless magic keyboard , the Fitbit Charge HR Wireless Activity Wristband  and the Western Digital 1TB external hard drive  for the ultimate experience with your Apple computer.
The primary method is using launchctl, this will require the administrative password:
sudo launchctl unload -w /System/Library/LaunchDaemons/com.apple.metadata.mds.plist
Another approach is to use the older indexing method of “sudo mdutil -a -i off” which turns off indexing only, but more on that in a minute.
The guaranteed way to reenable Spotlight is to reload it into launchd using launchctl:
sudo launchctl load -w /System/Library/LaunchDaemons/com.apple.metadata.mds.plist
Again, the alternate approach is the indexing related “sudo mdutil -a -i on” command, but that method can throw the “Spotlight server is disabled” error and not allow you to turn it back on. If you run into that problem, use the sudo launchctl load command instead to enable both indexing and Spotlight.
After Spotlight has fully reloaded launchd, mds agent will start reindexing to the filesystem. The time will be different for each used based on the number of changes that were made and new files since the last time MDS ran. You can verify that MDS is running through Activity Monitor or by pulling down the Spotlight menu to see an “Indexing Drive Name” progress bar.
Another option is to selectively disable Spotlight indexing of specific drives or folders by excluding them from the index, that is much easier to do and does not involve the command line at all, and instead you only need to drag & drop items into the Spotlight control panel.
It’s important to know that some other Mac OS X features and programs are supported Spotlight’s search and other apps could not work differently if you disable Spotlight search. But there are specific cases where turning Spotlight off is a logical decision, and having the ability to reenable Spotlight using the commands from above makes the process easy to reverse should the need reverse the change.