Mail Search Madness!

Discussion in 'macOS' started by skunk, Mar 18, 2007.

  1. skunk macrumors G4

    skunk

    Joined:
    Jun 29, 2002
    Location:
    Republic of Ukistan
    #1
    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?
     
  2. Lixivial macrumors 6502a

    Lixivial

    Joined:
    Jan 13, 2005
    Location:
    Between cats, dogs and wanderlust.
    #2
    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".
     
  3. skunk thread starter macrumors G4

    skunk

    Joined:
    Jun 29, 2002
    Location:
    Republic of Ukistan
    #3
    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...
     
  4. Lixivial macrumors 6502a

    Lixivial

    Joined:
    Jan 13, 2005
    Location:
    Between cats, dogs and wanderlust.
    #4
    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.
     

Share This Page