The Mac Observer

Skip navigational links

You're viewing an article in TMO's historic archive vault. Here, we've preserved the comments and how the site looked along with the article. Use this link to view the article on our current site:
Rebuilding Spotlight's Database

TMO Quick Tip - Rebuilding Spotlight's Database

by , 7:30 AM EDT, July 21st, 2006

Picture this: You need to find a document on your hard drive, but can't remember where it is. "No problem," you think, "I'll just fire up Spotlight and find it in a couple of seconds." Except that Spotlight can't find the file, even though it's found it before. Sounds like your Spotlight database needs to be rebuilt.

Luckily, forcing Spotlight to rebuild its hidden database is easy, and you don't have to buy any special software. Here's how:

  • Launch System Preferences. You'll find it hiding in the Apple menu.
  • Select the Spotlight PreferencePane.
  • Click the Privacy tab.
  • Drag your hard drive into the Prevent Spotlight from searching these locations list.

  • Add your hard drive to Spotlight's Privacy list to delete the corrupt database.
  • Quit and relaunch System Preferences.
  • Go back to the Privacy tab in the Spotlight PreferencePane.
  • Select your hard drive.
  • Click the minus button at the bottom of the list.


Remove your hard drive from the Privacy list to let Spotlight rebuild the database.

Adding your hard drive to the Privacy list not only prevents Spotlight from searching it, but it also deletes the database it has already created. Removing your hard drive from the list lets Spotlight build a new database without any of the corruption that the original had.

Keep in mind that Spotlight can't properly search your hard drive while it is rebuilding its database. Depending on the number of documents you have, that could take several hours or more.


if you have ideas for Mac related tips that you think other TMO readers might find helpful.

Observer Comments

Show: Subjects Only | Full Comments
Close Name:Brutno Posts: 198 Joined: 28 Aug 2002
Subject: Thanks

Nice tip!

Close Name:brett_x Posts: 322 Joined: 24 Jan 2006
Subject: Spotlight is the worst feature in Tiger.

Spotlight is the worst-implemented feature in Tiger. This article points that out:

Quote
Except that Spotlight can't find the file, even though it's found it before...
.
Since when did end users have to fix their search tool? Isn't that the FINDER's job? Why should end users have to know that a spotlight database even exists?
It is absolutely insane that over a year after Tiger is released, Spotlight is still severely broken. Each update to 10.4 that has come out, I have hoped that it is fixed. Nope. There is not even a utility to fix it (like some third party utilities that are available). I manage about 150 mac users. This has held back rolling out Tiger because our users will no longer be able to reliably search for a file.

Good tip, but it is an absolute shame that it is needed.

Oh yeah, If you're not afraid of the command line...You can use mdutil in terminal to rebuild your database as well. There is a man page to learn the switches.

Close Name:spliceguys Posts: 1 Joined: 21 Jul 2006
Subject: awful severe??

As with 'any' program, spotlight 'can' be corrupted, but it's not normally the case..

To say that you're not upgrading your 150 users to Tiger simply because there's no reliable way to find files is just plain dumb, and sounds more like an excuse.. Heck, you probably shouldn't even have your files on a computer, since there's no assurance that the hard drive isn't going to crash.

Not to be name calling, but you're simply missing out on a LOT of great feaures, plus speed boosts that Tiger has over Panther.

Close Name:jinkies -   Evil Girl of TMO Posts: 3846 Joined: 24 Sep 2001
Subject:

Be that as it may, the simple fact is that Spotlight is a proc hog, and is less efficient than the good ol' "find" function which it replaced. I've killed Spotlight all together on my system, which has reduced processor load, decreased the heat output of my Powerbook (and it was 101F today, so that's key), as well as extending the battery life.

If I really need to find something, I use Quicksilver.

Close Name:brett_x Posts: 322 Joined: 24 Jan 2006
Subject: Re: awful severe??

Quote
spliceguys wrote:
As with 'any' program, spotlight 'can' be corrupted, but it's not normally the case..
To say that you're not upgrading your 150 users to Tiger simply because there's no reliable way to find files is just plain dumb, and sounds more like an excuse.. Heck, you probably shouldn't even have your files on a computer, since there's no assurance that the hard drive isn't going to crash .


Well, part of our workflow happens to have some people search for files that have been created in the past to make sure we don't have to do any re-shoots. (Yes, there is a database as well, but it isn't always updated as it should be.) We need absolutely accurate file searching, or we'll be spending money re-shooting products that are already done.
As for the files... they are on a server in the first place. And spotlight is very inconsistent in that manner.
If we could just have our old search back as an option...

Close Name:Guest
Subject: CLI (terminal) way to do the same

Use the mdutil command-line executable to flush the spotlight caches, and force them to be rebuilt.

http://www.hmug.org/man/1/mdutil.php

Close Name:Guest
Subject:

Mmm... Quicksilver. Findy goodness.

But I use Spotlight a lot. No problem here. Tiger. Leopard. Sweet. What's the beef?

Close Name:Guest
Subject: Re: awful severe??

Quote
brett_x wrote:
Well, part of our workflow happens to have some people search for files that have been created in the past to make sure we don't have to do any re-shoots. (Yes, there is a database as well, but it isn't always updated as it should be.) We need absolutely accurate file searching, or we'll be spending money re-shooting products that are already done.
As for the files... they are on a server in the first place. And spotlight is very inconsistent in that manner.
If we could just have our old search back as an option...


Well, one wonders a couple of things on hearing that.

1. Why is your database not being used to create new jobs? If it were, then creators, dates and critical keywords could be used as part of each file creation, which in turn would throw up flags for files of a similar type, thereby killing two birds with one stone, right?

2. I'm assuming you're non-profit. A commercial operation surely would have no objections to being asked, and paid, to do a job twice.

Close Name:Guest
Subject: No, this is definitely bad...

Both I and a colleague have identical macbook pro's and both of us realized at the same time that our spotlight searches were not working at all. I'll bet that there are many users out there that have this problem and don't realize it. I am sure that it has been a couple of months at least that I have had the problem and was completely oblivious to it. But my searches were not working...

I don't think this is within the tolerances of normal functioning of a feature as important as this.

Sean

Comment on this Article


You cannot edit your comments.   You cannot delete your comments.

Comments are currently closed. Please email the author instead.


Recent Headlines - Updated February 9th

Tue, 10:38 AM
Quick Look Review - Texas Tea for the iPhone and iPod touch
10:25 AM
News - Apple Rolls Out Aperture 3 Video Tutorials
10:00 AM
Hot Forum Topic - Backing Up Your iPhoto Library
9:35 AM
Product News - Notebook, iThoughts Add TextExpander touch Support
9:00 AM
Hidden Dimensions - The Killer Surprises Waiting for Steve Ballmer
8:50 AM
Product News - Aperture 3 Adds Faces Support, More [Updated]
8:30 AM
TMO Quick Tip - Fixing iPhone and MobileMe Sync Headaches
8:12 AM
News - Apple Store Offline, Rumors Point to New Laptops
8:00 AM
TMO Appearances - TMO’s Bryan Chaffin and the Atomic Love Bombs Perform During Macworld Expo
Mon, 5:37 PM
News - Juniper Readies Software to Improve Cell Carrier Networks
5:17 PM
Macworld Expo - Macworld Expo 2010 Hess Party List Goes Online
4:11 PM
News - Survey: iPad Announcement Increased Awareness, Fails to Convert New Buyers

The Mac Observer Reader Specials

  • __________
  • Buy Stuff, Support TMO!
  • Podcast: Mac Geek Gab
  • Podcast: Apple Weekly Report
  • TMO on Twitter!