on fixing Spotlight issues with mail.app (and others for that matter)

So, after a while of using Mail.App, the spotlight searches seemed to start taking longer and longer. Even worse, they started not showing the results for stuff that I knew was in there. A little google, and some man and I found “mdimport”. This utility helps you manage and re-import the metadata databases in Spotlight. Here’s what I did:

pal:~ juan$ mdimport -L
2006-05-17 15:59:19.900 mdimport[8546] Paths: id(501) (
"/Library/Spotlight/Microsoft Entourage.mdimporter",
"/Library/Spotlight/Microsoft Office.mdimporter",
pal:~ juan$

This shows you all of the installed importers. You can then tell mdimport to re-import any or all of these via. For example, to re-import my mail, I did:

pal:~ juan$ mdimport -r /System/Library/Spotlight/Mail.mdimporter

This took a long time (a few hours), but after that, I had a clean, fresh, fast, and accurate spotlight on my mail.

2 Responses to “on fixing Spotlight issues with mail.app (and others for that matter)”

  1. rshangle says:

    Recently went through a similar journey that wound up at a slightly different endpoint. Spotlight appeared to questionably meta-data’d across the board.

    trogdor-5:/usr/bin rshangle$ man mdutil
    trogdor-5:/usr/bin rshangle$ df -k
    Filesystem 1K-blocks Used Avail Capacity Mounted on
    /dev/disk0s3 292905072 226657840 65991232 77% /
    devfs 115 115 0 100% /dev
    fdesc 1 1 0 100% /dev
    512 512 0 100% /.vol
    /dev/disk1s3 292926240 234826080 58100160 80% /Volumes/Backup0000-0000 1
    automount -nsl [194] 0 0 0 100% /Network
    automount -fstab [202] 0 0 0 100% /automount/Servers
    automount -static [202] 0 0 0 100% /automount/static
    /dev/disk2s10 159940248 120330652 39609596 75% /Volumes/dcf0000-0007
    /dev/disk3s6 488353088 348079128 140273960 71% /Volumes/Backup0000-0001
    /dev/disk4s6 490193424 483202544 6990880 99% /Volumes/Mobile DCF 1
    /dev/disk5s2 1162664 857388 305276 74% /Volumes/iDisk 1
    http://idisk.mac.com/rshangle/ 2147483647 0 2147483647 0% /Volumes/rshangle
    trogdor-5:/usr/bin rshangle$ mdutil -E /Volumes/Backup0000-0001

  2. rshangle says:

    Yeah… the end of that previous comment, which didn’t quite make it, should have indicated that:

    mdutil -E /Volume/name

    … will blow away all Spotlight metadata for the volume named name… it gets rebuilt automatically later.


You must be logged in to post a comment.