24 June, 2006

Spotlight indexing inside DMG files

Filed under: Software — Roman @ 19:35

Spotlight Raw Query .emlx searchIn Mac OS Tiger when files are copied to a disk image (virtual disk , extension .dmg) Spotlight doesn’t index the files. In order to turn indexing for these virtual drives run Terminal and enter:

sudo mdutil -i on /Volumes/volume_name

After Spotlight finishes indexing the volume it finds much more than just file names! :)

Index information is always stored in the disk/volume in question, therefore no additional resources are used when the disk image (.dmg) is not mounted.

But this is not all. If you try the above trick for storing an archive of your email messages (since Tiger all separate .emlx files) Spotlight won’t find anything. Don’t be fooled, .emlx are, in fact, indexed, but they are excluded from the search results.

There is a trick…

Go to Finder, start a new search, choose Other from the first drop-down menu and choose Raw Query. This opens the doors to a whole new world of searching! An example query is in the attached screenshot. It finds all emails with the words “Hannes” and “gut”. The query for this is the following:

(kMDItemTextContent ==Hannes && kMDItemTextContent ==gut)

The infinite possibilities for queries are discussed in Apple developer pages, try Query Expression Syntax or Spotlight Metadata Attributes

Remember that these searches can be literally infinitely combined and even saved in smart folders, I suppose. Fathom the possibilites… ;)

No Comments »

No comments yet.

RSS feed for comments on this post. TrackBack URI

Leave a comment