• On GameFAQs: The top 10 most terrifying PC games
advertisement
November 10, 2006 4:10 AM PST

Tutorial: Troubleshooting Spotlight

by CNET staff
  • Font size
  • Print
  • 32 comments

Spotlight was touted as one of the most generally useful new features in Mac OS X 10.4 (Tiger). Using a home-brewed metadata indexing system, Apple delivered a search mechanism that claims superior speed, accuracy and manipulation of results relative to engines offered by previous iterations of Mac OS X and various Windows flavors.

Unfortunately, many users found Spotlight to represent a step backward in some respects when compared with the simple find functionality offered in Mac OS X 10.3 (Panther) and its predecessors. On slower systems, or when subject to index corruption and other problems, Spotlight itself can prove sluggish and cause other applications slowness as well. It can also have problems returning accurate results under some circumstances.

Let's take a look at some of the most pressing Spotlight troubleshooting issues and how to work around them. As a last resort, we'll examine turning Spotlight off completely and seeking a replacement.

Spotlight's limitations First, there are a couple limitations you should know about before deciding whether or not to use Spotlight as your primary local search engine.

Invisible files Spotlight, in its current form, refuses to find invisible files. Although the user can set a criterion to search for both visible and invisible files, or invisible files only (through the Finder-based method of accessing Spotlight), no files are found.

Files containing single asterisks Spotlight cannot find files and folders containing a single asterisk (*). It can find a single asterisk in a file name as long as it is not at the end of the name or a word in the name without an asterisk at the beginning of the name.

For instance, out of the following filenames:

  1. *XXXXX
  2. XXX * XX
  3. XXX*XX
  4. XXXXX *
  5. XXXXX*
  6. XXXXX**

Spotlight will find 1, 2, 4, and 6, but miss 3 and 5.

Places it will not search There are some limitations to where Spotlight will search. For instance, Spotlight will not search in bundles such as frameworks and application packages.

Performance boosters (for Spotlight and the system) As aforementioned, Spotlight can be downright slothful when afflicted with index problems, when other system processes are hogging resources, or in other situations. Fortunately, there are a few procedures you can use to boost the speed with which search results are returned.

In addition (and more importantly for some users) there are workarounds you can use to minimize Spotlight's impact on the rest of the system.

Paste search strings One of the biggest gripes with Spotlight is a sometimes dramatic pause that occurs after typing one or two characters, as Spotlight begins searching immediately for all data containing those letters. There is a simple tip for avoiding this slow-down: Type the search string in an open text field then copy and paste the text into the Spotlight search field.

Disabling indexing for certain folders For some users, simply turning off Spotlight indexing for particular problem folders will resolve performance issues -- decreasing the time interval between search term entry and results display, as well as taking less of a toll on the system.

For instance, the mailbox folders used by some e-mail applications will be re-indexed every time a small change is made, resulting in spikes in processor usage.

Folders can be excluded in the "Spotlight" pane of System Preferences in the "Privacy" tab. Simply click the "+" button in the lower left corner and select the folder to be excluded, or drag the desired folder to the list.

Temporarily disabling Spotlight and re-launching Another workaround that has proved successful for some users is simply turning off the Spotlight indexing process for installed volumes then turning it back on. Here are instructions for doing so in the Terminal:

1) Using the mdutil command-line utility in Terminal, turn off indexing for each of your drives. Example:

  • sudo mdutil -i off /Volumes/your_hard_drive_name_1
  • sudo mdutil -i off /Volumes/your_hard_drive_name_2

2) Then use mdutil to remove the indexes from each drive

  • sudo mdutil -E /Volumes/your_hard_drive_name_1
  • sudo mdutil -E /Volumes/your_hard_drive_name_2

3) Physically remove the .Spotlight directories from the root of each drive.

  • cd /Volumes/your_hard_drive_name_1
  • sudo rm -fr .Spotlight-V100

(do the same for your second or third drive)

Make sure to carefully type the "rm" command -- a typo could result in deletion of critical files.

4) Use mdutil again to turn indexing back on for each drive

  • sudo mdutil -i on /Volumes/your_hard_drive_name_1
  • sudo mdutil -i on /Volumes/your_hard_drive_name_2

5) Spotlight will now re-index all drives and should behave in a normal fashion. (No longer use 60%-80% of your CPU)

Killing the mdimport process Klling the mdimport process via the Terminal commands:
  • ps -auxwww | grep mdimport
followed by
  • kill -9 theprocess#returned

reduces processor monopolization by Spotlight.

Giving Spotlight processes less priority via "renice" For some users, giving Spotlight processes less system priority via the "renice" command results in better overall system performance, though performance from Spotlight itself may suffer.

The easiest way to perform this process is to enter the following command in the Terminal:

  • renice -n (new renice setting number) -p (process ID number)

The higher the renice setting number (up to 20), the lower the process priority. The process ID number for various Spotlight operations can be found using Activity Monitor (located in Applications/Utilities). The most implicated process is mds -- launch Activity Monitor, and note the process number next to mds.

  • renice -n 19 -p NNN

(where NNN is the process number received from Activity Monitor. You can also get the process ID for "mds" with the Terminal command "ps -acx | grep mds")

This can also be accomplished with the freeware utility BeNicer. After downloading an launching this application, enter "root" as the user and select the "mds" process, then change its renice setting to a higher number (18 or 19).

Disable Spotlight for backup target volumes Users should disable Spotlight for backup target volumes (by using the "Privacy" tab of the Spotlight pane in System Preferences) before beginning the backup process to prevent live indexing as the files are copied.

Failing to do so can result in failed backups, significant performance issues, and other problems.

Note that this procedure must be repeated each time a backup drive is unmounted, then re-connected and made to receive data.

Do not attempt to use Spotlight before other menu items load Scott Rose notes that if you attempt to perform a Spotlight search from the Mac OS X menu bar before other, third-party menu bar items have loaded, it will not function properly.

Kill the SystemUIServer process Launch the Activity Monitor application (located in Applications/Utilities). Look for the Process Name SystemUIServer. Select it, then click "Quit Process" (the red button in the upper right that looks like a stop sign) and confirm the quit. The menubar should refresh after quitting this process. Wait a minute or two then re-attempt usage of Spotlight.

Improving results accuracy 

Reviving unsearchable folders In some cases, folders can seemingly spontaneously become unsearchable by Spotlight, with the search function refusing to find the folder itself or any items contained therein. This problem can sometimes happen after an Archive and Install process. For instance, if items in the "Previous System" folder are moved back to an active user folder, Spotlight may not be able to find anything within that user home folder. This problem can usually be remedied via the following process:
  1. Open the Spotlight pane of System Preferences
  2. Click on the Privacy tab
  3. Drag the problematic (unsearchable) folder into the field, adding it as a place Spotlight does not search
  4. Quit System Preferences
  5. Re-open System Preferences and again click on the Spotlight pane
  6. Remove the folder from the Privacy field
  7. Quit System Preferences again

Files that can choke Spotlight Certain types of files are not handled well by Spotlight, include the following:

Future creation/modification dates causing problems, workaround Certain iterations of Spotlight have some serious issues dealing with files that have creation dates in the future. 

As such, if you've not yet installed Mac OS X 10.4 (Tiger) on a system, you might want to run run Norton Disk Doctor 8.02 (which has a feature that corrects these files dates) to fix such wrong dates before installing Tiger. Norton Disk Doctor is not compatible with Tiger, so, again, it should be run pre-update.

Finder.DAT files Spotlight may have problems indexing and searching for Finder.DAT files -- data files usually containing text created by an older Classic Mac OS application like ClarisWorks or spawned by another third-party application. Try eliminating these files if you are experiencing stalls or other problems with Spotlight.

Entourage data Spotlight may not properly search Entourage data under some circumstances. There are a few fixes for this issue:

  • Open Entourage's preferences and press "rebuild" under Spotlight Preferences
  • Restart and wait a few minutes while Spotlight indexes the new data.
  • Move the files "Microsoft Entourage.mdimporter" and Microsoft "Office.mdimporter" from /Library/Spotlight to ~/Library/Spotlight and then use the following command in the Terminal (the Terminal is located in Applications/Utilities): mdimport ~/Library/Caches/Metadata/Microsoft/Entourage/2004

Disabling Spotlight, turning it off completely; seeking alternatives

You can temporarily disable Spotlight easily with the shareware tool Spotless. This tool also allows you to delete existing Spotlight indexes, and can easily recreate the ".Spotlight-V100" directory, which can become damaged for various reasons and cause indexing problems.

If you absolutely cannot live with Spotlight in any dose, you can turn it off completely by editing Mac OS X's hostconfig file, which determines the system components that are loaded at startup. This can be accomplished via the following process:

First, enter the Terminal and use the command:

  • sudo pico /etc/hostconfig

to open the hostconfig file in the "pico" text editor. (For more information about using pico, type the command "man pico" in the Terminal).

Scroll down the hostconfig file and file the line that says "SPOTLIGHT=-YES-" and change it to: "SPOTLIGHT=-NO-" (without quotes).

Exit pico, saving the file, and restart Mac OS X. Spotlight will no longer launch at startup.

To go one step further and remove Spotlight from the menu bar, remove the file "Search.bundle" from the folder /System/Library/CoreServices (move it to the Desktop or another external location) and again restart.

Once you've removed Spotlight, it's time to find a replacement. The most popular alternative search utility for Mac OS X is EasyFind. This program does not rely on indexing to do its thing, and is freeware. It will not deliver intra-document results with the accuracy achieved by Spotlight, but is considerably less resource-intensive and does not suffer from some of Spotlights file-type limitations. It can, for instance, search for invisible files and files inside packages. Other alternatives include:

Like what you've found in this tutorial? Get more troubleshooting guidance (updated daily) by subscribing to MacFixIt Pro.

Resources

  • BeNicer
  • Spotless
  • EasyFind
  • NotLight
  • LiveSearch
  • NameFind
  • FoxTrot Personal Search 1....
  • subscribing to MacFixIt Pr...
  • More from Tutorials
  • Recent posts from MacFixIt
    iTunes 9.0.3 breaks AirTunes connection for some
    Apple releases Aperture 3.0
    Manage iCal's automatic e-mail generation for invitations
    CNET TV Apple Byte: Apple faces critics
    Weekly Utilities Update: Net Monitor, MiniUsage, TimeMachineEditor, more...
    Odds and Ends: Essential video codec packs for OS X
    Address Book: Unable to add, view contacts
    Persistent 'Faster Browser Search' overtaking Safari's default search
    Add a Comment (Log in or register) Showing 1 of 2 pages (32 Comments)
    by macmikey2 November 10, 2006 7:11 AM PST
    My Entourage Preferences do not have a Spotlight preference. Where does this preference show up? Older versions maybe?
    Reply to this comment
    by prolaw1 November 10, 2006 7:11 AM PST
    >
    This is a reply to a previous comment by macmikey2


    Make sure you have downloaded the latest version of Office. It is there on Office 2004 with updating. Under the Help menu, go to check for updates or download updates.
    Reply to this comment
    by MacFixItUser November 10, 2006 7:19 AM PST
    Spotlight can be great but also can be a real pain. Hopefully Apple will address the following issues:

    1. Plain searches. Just as Panther or Mac OS 9 did. And not, I do not want the search by kind by default. I usually search by name contains... and please, remember that. Allow me to custom define how Command F opens!

    2. Search without previous indexing. At least do not give me FALSE negative results just because the index is not built. See Easy Find!

    3. Do not index by default. Please! When I connect an external drive, I DO NOT want to index it. I may want to search on in (plain search), but NEVER WANT TO INDEX IT. Please!!!

    4. Likewise, when I install a new system by scratch, make repairs or backups I do not want to Index right them. LET ME DECIDE WHEN AHD WHAT TO INDEX.

    5. And for God's sake, please DO NOT DELETE the full index (requiring) a full 12-hour rebuild of such index whenever I stop indexing placing the disk in the Private area. And do not do the same when I stop indexing external drives. ALLOW ME TO STOP AND RESUME INDEXING WHENEVER I WANT.

    6. Please, find what is in my disk. Spotlight does fail far too often, does not find some fimes, does not search inside sime folders, does not find ever some invisible files that are found by Easy Find or revealed by Macintosh Explorer, etc. Relly frustrating. Even worse: misleading, since you get a FALSE NEGATIVE result. Worst is impossible.

    7. All in all Spotlight is a marvel or a pain in the back frustrating irritating experience. Apple, where are thou and the Mac spirit? --please, bring it back!

    In summary do not index by default, yet allow searches as Panther or Mac OS 9 or Easy Find do. Then allow me to turn on/off/stop/resume indexing whenever I want. And in any case, when I do a search inside a volume that is not indexed or with an stopped indexing feature, just tell me that and I will decice if I resume or not indexing. And above allo, find all kind of files, visible or invisible whenever they are --please do not decide what I can see and what I cannot!!!-- and never ever delete an index that I must then rebuild from scratch just because I placed the disk in the private tab. Ever!
    Reply to this comment
    by baltwo2 November 10, 2006 7:19 AM PST
    >
    This is a reply to a previous comment by null


    For item #1, try this:

    Probably, because Finder's Find excludes /System and some hidden directories unless they're dragged into the Find window (Apple's way of protecting the system from being abused by the uninitiated).

    Modify Finder's Find so that it shows filename (not name) and invisible as its first two choices (modify it to suit your needs).

    Copy the /System/Library/CoreServices/Finder.app/Contents/Resources/default_smart.plist to the desktop. Change the one in Finder to default_smart.plist.bak so you can restore it later if required. Open the one on the desktop in TextEdit and change it from:

    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
    <plist version="1.0">
    <dict>
    <key>RawQuery</key>
    <string></string>
    <key>SearchCriteria</key>
    <dict>
    <key>CurrentFolderPath</key>
    <string>/</string>
    <key>FXCriteriaSlices</key>
    <array>
    <dict>
    <key>FXSliceKind</key>
    <string>Skin</string>
    <key>Value</key>
    <string>KI**</string>
    </dict>
    <dict>
    <key>FXSliceKind</key>
    <string>Slsv</string>
    <key>Value</key>
    <string>DA**</string>
    </dict>
    </array>
    <key>FXScope</key>
    <integer>0</integer>
    </dict>
    <key>Version</key>
    <string>10.4</string>
    </dict>
    </plist>


    To read:

    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
    <plist version="1.0">
    <dict>
    <key>RawQuery</key>
    <string></string>
    <key>SearchCriteria</key>
    <dict>
    <key>CurrentFolderPath</key>
    <string>/</string>
    <key>FXCriteriaSlices</key>
    <array>
    <dict>
    <key>FXAttribute</key>
    <string>kMDItemFSName</string>
    <key>FXSliceKind</key>
    <string>Othr</string>
    <key>Operator</key>
    <string>S:**</string>
    <key>Value</key>
    <string></string>
    </dict>
    <dict>
    <key>FXSliceKind</key>
    <string>Svis</string>
    <key>Value</key>
    <string>No%20%20</string>
    </dict>
    </array>
    <key>FXScope</key>
    <integer>0</integer>
    </dict>
    <key>Version</key>
    <string>10.4</string>
    </dict>
    </plist>

    Replace the one in /System/Library/CoreServices/Finder.app/Contents/Resources/ with the modified one, Option-click on the Dock's Finder icon and select relaunch. Select CMD+F and see the new Finder's Find dialog box. I still haven't determined how to change the focus so that the cursor pops up in top category. In this case Filename contains. It always starts in the search box.

    Another option, if you don't want to modify the plist, is to CMD + F, set it up the way you want it, enter a search term, and when it finishes searching, save it to the desktop. Drag the file into text edit and it will show you how the plist will look for that particular search. Modify it accordingly to suit your needs.
    Reply to this comment
    by baltwo2 November 10, 2006 7:19 AM PST
    >>
    This is a reply to a previous comment by baltwo2


    Ignore the second paragraph. Fat-fingering error when copying and pasting.
    Reply to this comment
    by John Sawyer November 10, 2006 7:19 AM PST
    >>
    This is a reply to a previous comment by baltwo2


    I do what baltwo2 describes above for many OS 10.4 installs I do for clients--I have a saved copy of the modified default_smart.plist file, and use it to replace the original. Makes a nice difference to have "find by name" as the default, instead of Apple's "find by kind", which very few people need.

    You should also repair permissions after doing this, since the process messes up permissions for the default_smart.plist file. I don't know if these messed-up permissions cause any trouble, but you might as well fix them just in case.

    Also, baltwo2's step for relaunching the Finder after replacing the default_smart.plist file is crucial--otherwise the Mac may crash when you enter Command-F to bring up the Find window. Sometimes I've found it necessary to restart the Mac to prevent this from happening.
    Reply to this comment
    by Kris Hunt November 10, 2006 7:19 AM PST
    >>
    This is a reply to a previous comment by baltwo2


    Is there a version of this modification that works in Leopard?
    Reply to this comment
    by fotoman November 10, 2006 8:58 AM PST
    The previous post is right on! Is there any way to go back to the search function of OS 10.3.9?
    Reply to this comment
    by barrom November 10, 2006 8:58 AM PST
    >
    This is a reply to a previous comment by fotoman


    I posted a script on my blog, a long time ago when Tiger was brand new, that allows for disabling Spotlight and returning to Panther-style searches. Please read the caveats listed in the script before using.

    http://systemsboy.blogspot.com/2006/03/scripts-part-5-new-spotlight-disabler.html

    Hope you find this useful.

    -systemsboy
    Reply to this comment
    by Rick Deckard November 10, 2006 8:58 AM PST
    >
    This is a reply to a previous comment by fotoman


    You can just use EasyFind, it's a great program and pretty much duplicates the old, much beloved OS 9 Find features.
    Reply to this comment
    by griff--2008 November 10, 2006 9:03 AM PST
    I disabled Spotlight long ago for the stated reasons. The most useful tool I have found to be the excellent Finder substitute Path Finder from CocoaTech. The search engine that comes in it is very powerful and fast, plus it does everything the Finder, Preview, and Texedit and Terminal does and much more.

    Griff
    Reply to this comment
    by Gennx30 November 10, 2006 9:36 AM PST
    I ditched SPOTLIGHT on day 1.
    It was a pain in the frikken a**.
    I use EASYFIND, which does EXACTLY what I want, and quickly (just like Panthers search).
    I you put in a word to search for, (say you want to find and delete anything Microsoft, you just type it in, and it will find ALL of the files left behind. Most app 'uninstallers still leave tons of cr*p behind, ive found, and EASYFIND is the way to take care of that.

    I also use SPOTLESS which disables SPOTLIGHT;
    in fact ive used Easyfind to find all traces of Spotlight,
    except the 2 V-card Spotlight files with are linked to address book, just to save the space.
    All works well
    Reply to this comment
    by Tracy Valleau November 10, 2006 10:02 AM PST
    Items to be searched or not searched should NOT be set in the System Preferences (particularly removable drives, which have to be re-added each time).

    The "should Spotlight Index this?" (drive, file, folder) should be set in the item's GetInfo box.
    Reply to this comment
    by John Sawyer November 10, 2006 10:02 AM PST
    >
    This is a reply to a previous comment by tracy valleau--2008


    Problem is, there is no such option in an item's Get Info window.
    Reply to this comment
    by MacFixItUser November 10, 2006 10:25 AM PST
    Is there a way to send this article and thread to Apple. Maybe they hear us, after all... Hopefully for Leopard at least!
    Reply to this comment
    by djknet November 10, 2006 11:34 AM PST
    Although its somewhat expensive just as a find utility File Buddy is about 4 times faster on my computer than EasyFind. It also does a lot more than just find files and is extremely configurable.
    Reply to this comment
    by lcpguy November 10, 2006 11:34 AM PST
    >
    This is a reply to a previous comment by djknet


    I agree. I tried EasyFind but it way slower than FileBuddy 8 on my iMac G5 1.8

    Spotlight is out of my system.
    Reply to this comment
    by 6sv7vps02 November 10, 2006 2:43 PM PST
    Whoever wrote this needs a grammar checker, quick.
    Reply to this comment
    by November 10, 2006 2:43 PM PST
    >
    This is a reply to a previous comment by 6sv7vps02


    Grammarian pro 1.7 universal is now available
    Reply to this comment
    by Cowicide November 10, 2006 4:35 PM PST
    I run Tiger on an older G4 and it flies compared to Panther, but ONLY if I keep Spotlight OFF. Therefore, I'm stuck not being able to search unless I use a bunch of 3rd party apps to replace it.

    It's this reason, I'm still forced to use Panther, because I want to be able to simply to a search within a folder's window, quick.. without using a 3rd party app.

    This is insane. I hate Spotlight. If Apple would JUST PLEASE let people turn that POS OFF and revert to Panther style searching... all would be good in the world.

    Apple??????????????????
    Reply to this comment
    Showing 1 of 2 pages (32 Comments)
    advertisement

    About MacFixIt

    MacFixIt is CNET's troubleshooting resource for all things Mac. The information here helps you navigate the ins-and-outs of Mac ownership with how-tos, troubleshooting information, news, reviews, and more.

    Add this feed to your online news reader