A friend installed his new Tiger today and found that only the files that was on his drives at first boot is in the spotlight database, nothing new was being added.
At first glance everything looked fine, but this very simple test will confirm if spotlight is working or not:
[rip@temptation]% touch test [rip@temptation]% mdls test test ------------- kMDItemAttributeChangeDate = 140116-07-24 20:14:56 +0000 kMDItemFSContentChangeDate = 2005-04-30 00:10:37 +0100 kMDItemFSCreationDate = 2005-04-30 00:10:37 +0100 kMDItemFSCreatorCode = 0 kMDItemFSFinderFlags = 0 kMDItemFSInvisible = 0 kMDItemFSLabel = 0 kMDItemFSName = "test" kMDItemFSNodeCount = 0 kMDItemFSOwnerGroupID = 501 kMDItemFSOwnerUserID = 501 kMDItemFSSize = 0 kMDItemFSTypeCode = 0 kMDItemID = 531254 kMDItemLastUsedDate = 2005-04-29 23:10:37 +0100 kMDItemUsedDates = (2005-04-29 23:10:37 +0100)
This creates a new file and then asks spotlight to list the metadata for this file, if spotlight isn't indexing then nothing will be displayed after the second command. This was the case for this user.
Spotlight has a command line control tool called mdutil(1) that can start, stop and display current indexing state among other things, I turned indexing off and back on for the / volume on his machine and all was fine.
[rip@temptation]% sudo mdutil -i off /
Password:
/:
Indexing disabled for volume.
[rip@temptation]% sudo mdutil -i on /
/:
Indexing enabled for volume.
After that the simple test above should work. Note though that the new files may not immediately show up in search results since its likely that your machine may be now importing quite a few files into the datbase in a low priority background task, but things should be back to normal eventually.
In some cases though it seems not even this kicks the bugger back to life. So it is time to get a bit tough on it, so you can completely whipe the spotlight data store for a volume which will cause a immediate resync.
$ mdutil -E /
After this your spotlight will not work for a while, it will be like right after a fresh install, once it is done rebuilding and your spotlight icon lets you run searches it seems a reboot is in order, when you are back from the reboot it should all be good.
A quick test is to run a search for something in the spotlight GUI, click on 'Show All' and while this window is open make a folder or something that will match your query in a terminal, your spotlight results should dynamically update to include the new match.
UPDATE: You can also force a re-index by adding your whole harddrive to the Spotlight 'private' list and then removing it from the list after a while. Using this method you wont need a reboot or anything, plus it's reachable by the GUI.

I get these errors when I try (Spotlight used to work, now doesn't -- can't find anything. When I try to add my hard drive to privacy to trigger re-indexing, it doesn't take (i.e. it won't add it to list).) When I attempt to correct in terminal, I run into the problems below. Thoughts?
Arlo-Devlin-Browns-Computer:~ arlo$ sudo mdutil -E /
Password:
/:
Error, no index found for volume.
Arlo-Devlin-Browns-Computer:~ arlo$ sudo mdutil -i on /
/:
Could not set indexing status for volume.
I have this same issue with the MDUtil. Spotlight does not find any files and i get the same errors as above.
-Error, no index found for volume.
-Could not set indexing status for volume.
Did you fix yours yet
fixed it.
delete /Library/Spotlight
delete /.Spotlight-v100/*.* (something like that)
repair disk permissions on OS drive with disk Utility
reboot
hope it helps
I think it might have something to do with office, I forgot my unix command option for rmdir to delete subfolders even if they aren't empty so i went in finder..those .mdimporters have the little office icons on them..don't know but it might be a relation..office try to open metadata....rofl
please e-mail me if someone find solution or comments
I had a similar problem to the described user where mdutil could not indicate the current indexing status on the volume.
I proceeded with the tip given by Glenn and it fixed my problem.
Thanks!
I've been having problems with this as well. Applecare has no idea how to fix it, I've tried that and no avail.
My column view hangs as well. I think its related.
the other error I get is:
323: Can't checkin with server named com.apple.metadata.mdserver, error 0x10000004
Chris
AWESOME, worked perfectly! Thanks heaps!
I have had intermittent problems with spotlight on my macbook pro. Sometimes it would find stuff, sometimes it finds absolutely nothing. Here's the problem and the solution..
http://mattfleming.com/node/120
My issue is/was similar to Matt's. Spotlight would find some things, but not others. No pattern. For example I had it search for ".css" and it didn't find anything after 3 minutes of searching. When I had it look for "stylesheet.css", it found it immediately.
Other times, I could type the exact name or a partial name of the only file in a folder and it wouldn't find it.
I am yearning for the old Panther search at this point.
I deleted the index and it's now rebuilding - hopefully that solves the problem.
Success!: system preferences>spotlight>privacy>adding entire hard drive. Restart and then remove entire hard drive. Caused spotlight to reindex hard drive. Thanks for the help.