Optimization guide for Mac OS X Lion Spotlight, lionspotlight

Source: Internet
Author: User


Optimization guide for Mac OS X Lion Spotlight, lionspotlight


The newly bought mbp suddenly failed to use spotlight,


I saw this article using spolight to turn it off and then reopen the spotlight solution.




Source post link: Mac OS X Lion Spotlight optimization guide http://bbs.feng.com/read-htm-tid-4008789.html






Spotlight is something that I love and hate. On the one hand, it is really quite useful, but on the other hand, it does occupy a lot of system resources. When doing a lot of file operations, I often fill up the CPU, so I can burn my poor BNS to about 80 degrees, so I have to make a good effort with him. Here I will summarize some of the Spotlight tuning methods found in the past two days, I hope it will be helpful to you.

The following optimization is implemented on the Mac OS X Lion 10.7.2 system. Other versions of the system may be different. You can Google the specific method, however, the basic steps are similar.

Apple's Mac usage is no longer than a week, so many things may be wrong (what is possible, should it be?). What's wrong, please give me more comments and welcome to my blog: http://bigasp.com /.


Introduction to Spotlight


Spotlight is a search service in the Mac system. In order to make the search more rapid, the Mac system runs an index service in the background, such as file operations or data updates, such as iTunes and Mail, an index will be created for them to accelerate the Spotlight search.

Therefore, Spotlight is divided into two parts: the front-end Spotlight Search service Search. bundle, and the back-end Index Service mds.

Optimization of Spotlight is actually to optimize these two services.


Basic optimization solution: reduce the content to be indexed


Based on the above introduction, we can think that the simplest optimization is to reduce the content to be indexed.


First, select the content to be indexed in the Spotlight settings.

Choose system preference settings-& gt; Spotlight. In the search result Tab, select all the content we don't care about.

I only checked: application, system preference settings, address book and music. This is enough for me.



Then, add all the folders we do not need to index to the Spotlight blacklist.

In the privacy Tab of system preference settings-& gt; Spotlight, we can select directories that do not need to be indexed by Spotlight, we can use this directory to greatly reduce the amount of files we need to index.

Open the Finder, click Go-& gt; in the menu to go To the folder, go to the root directory/, and add all the folders except the application and user directories to the blacklist.



Note: In fact, user directories can also be blacklisted. Music, contacts, and emails displayed in Spotlight are directly linked to these software databases to create indexes, therefore, it is not closely related to the folder index. You can also add it to the blacklist. Let's take a look at everyone's preferences.


In addition, you must note that all the hidden files must be displayed in the Finder, because some directories related to the system, such as/usr, do not have to be indexed, can be blacklisted. If the file display method is not, You can Google it.


Finally, we need to set the hard disk to be indexed by Spotlight. Some mobile hard disks and USB disks do not need to be indexed.

Open the terminal and enter the following command:

# Disable the indexing service for all disks

Sudo mdutil-a-I off

# Only enable the Index Service of the primary hard disk. My primary hard disk is mounted to the/Volumes/Macintosh HD directory (default setting). You can modify it as needed.

Sudo mdutil-I on & quot;/Volumes/Macintosh HD & quot;


If the preceding command is incorrectly executed, you can use the following command to restore indexes on all disks.

Sudo mdutil-a-I on


Well, we have completed the first optimization.

At this point, we can see that Spotlight is re-indexing. On my machine, it would take two hours to create an index. Now it takes only a few minutes.


Replacing optimization scheme I: replacing the front-end part of Spotlight


OK. After completing the basic optimization scheme, we have castrated Spotlight to this field. We can simply replace Spotlight with other software.

Here is a good free software recommendation: Alfred. You can simply search for the installation in the App Store, and the process will not go into details.


Hide the Spotlight icon in the taskbar

The key to this solution is that since Spotlight is not needed, we do not need to display it.

The method to disable it is very simple. Enter the following command in the terminal:

Sudo mv/System/Library/CoreServices/Search. bundle/System/Library/CoreServices/Search2.bundle

Ps aux | grep SystemUIServer | grep-v grep | awk & #39; {print $2} & #39; | xargs kill


Now we will find that the Spotlight icon on the desktop is gone, and the optimization is completed.


Of course, it is easy to restore. You can run the following command to restore the data:

Sudo mv/System/Library/CoreServices/Search2.bundle/System/Library/CoreServices/Search. bundle

Ps aux | grep SystemUIServer | grep-v grep | awk & #39; {print $2} & #39; | xargs kill


Replacement optimization scheme II: replacing the entire Spotlight


Stopping Spotlight completely means not only disabling Spotlight desktop search, but also stopping the background Indexing Service of Spotlight.

So friendly reminder: there are monsters in front! After Spotlight is disabled, software dependent on the Spotlight index service will not be able to run normally. For example, Alfred will not be able to display the search results (dependent on the Spotlight Index Service mds). Please be careful with this, it has nothing to do with the author if it causes a strange problem.


This solution is my favorite for the moment, because the Spotlight Index Service is still running at any time in the system, so it will still occupy our system resources, and we cannot control it, it is our best choice to completely replace him.

Okay. Let's get started.


Completely stop Spotlight background Indexes

After replacing optimization scheme I, we can enter the following command to completely stop the Spotlight index.

Sudo launchctl unload-w/System/Library/LaunchDaemons/com. apple. metadata. mds. plist



After entering this command, you can check whether there are still processes of mds and mdsworker in the current system. They should all quit.

So far, we have basically killed Spotlight.


Of course, if we regret it, we can use the following command to restore it.

Sudo launchctl load-w/System/Library/LaunchDaemons/com. apple. metadata. mds. plist

After the restoration is complete, do not forget to check the content in the basic optimization solution, because after the background index service is stopped, the indexing will also stop.


Install alternative software

Can we still enjoy functions similar to Spotlight without the background Index Service?

Here we recommend a small software: Launchy. Download Page: http://www.launchy.net/download.php?osx. I have installed version 2.6 Beta 2.

This software will create its own indexes. Although it is not as powerful as Alfred in terms of functions, it is almost the same. Whether the indexing of images and videos is necessary is reserved by individuals, I believe everyone understands the cause, so it is enough for me.

In this software, we can set the index scope of the software, or disable it from automatically updating the index, so that we can maximize the control of this background service.


Summary


So far, the overall optimization of Spotlight has been completed. My poor mbp temperature has finally been reduced, and it will not cause a high temperature caused by a large number of file operations. In general, tossing is still somewhat effective. I hope it will be helpful to everyone.


============================== Lili split line ====================== =


Supplement

1. Launchy 2.6 Beta and 2.5 seem to often Crash on some machines, you can use QuickSilver (http://www.blacktree.com/), or search for other software to replace, as long as it is self-built index on the line.

2. In fact, without a large number of file operations, Spotlight has little impact on the system. The CPU usage of mds is generally about 3%-5%, and there is no need for optimization. However, if you find that the computer temperature is very high recently or the battery is very fast, you can check Spotlight and refer to this article for optimization.






Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.