Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

skunk

macrumors G4
Original poster
Jun 29, 2002
11,759
6,109
Republic of Ukistan
When I search my Mail messages, either directly in Mail or using Spotlight, I get completely weird results: a list of seemingly random messages totally unrelated to the search criteria. The same happens in iPhoto: I type in a word/name/title, and some completely unrelated picture comes up. To coin a phrase, WTF??? How can the metadata be so messed up, and what, if anything, can I do about it?
 
I guess your best bet may be to try to reindex the Spotlight indices. If you'd like to see some of the Spotlight-related metadata for, say, an email I'd recommend Highlight. Drag an email from ~/Library/Mail/{whateverinbox}/Messages and see what it says. You can also use the Terminal -- the command is mdls "/path/to/filename" It should contain the proper metadata. If not, the spotlight reindexing may take care of it.

Finally, if you don't want to rebuild your entire index and it's only a few apps that seem messed up, you can issue these commands in Terminal:

Code:
(For iPhoto)
mdimport -r /System/Library/Spotlight/iPhoto.mdimporter

(For Mail)
mdimport -r /System/Library/Spotlight/Mail.mdimporter

Unfortunately the mdimporters are a bit scattered, many are located in /System/Library/Spotlight, but some are /Library/Spotlight while others are actually located in each application's .app bundle.

EDIT: You can also try this hint, which is essentially saying "delete ~/Library/Mail/Envelope Index".
 
Thanks, but I have already forced a re-index of Spotlight. I'll try that Mail thing, but I fear it's more system-wide than that...
 
I'll try that Mail thing, but I fear it's more system-wide than that...

I agree that it's a bit of a long shot, especially since you say Spotlight queries in general are affected.

Did you confirm that Spotlight's metadata looks OK for photos and emails? For instance, one of the Spotlight's metadata items for an email file is the title, another is the email address. If it isn't then there's still something wrong with the Spotlight metadata store that is located in /.Spotlight-V100 or the importers are generating improper metadata -- otherwise that's an interesting issue. I wouldn't expect it to be importing improper metadata, and that entire metadata store is supposed to be rebuilt on a reindex, but it's not a bad idea to confirm.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.