Adding filetypes to Spotlight
From Mac Guides
|
This tip requires |
By default, Spotlight doesn't index every file on your hard drive, and it's not very user friendly to add additional types. This guide details how to add files to the spotlight index.
Contents |
[edit]
Index Third-Party Filetypes
A growing list of applications have Spotlight plugins available for download. These plugings usually take the form of a package and install all the necessary files (in /Library/Spotlight)
[edit]
Some Noteable Spotlight Plugins
For a complete list, see Apple's Spotlight download page
[edit]
Index PHP files
This section illustrates, by example, how to add PHP files to your spotlight index.
The Property List Editor showing the new PHP entry
- Install the developer tools
- In the finder, Go to "/Library/Spotlight" (command-shift-G)
- Control-click on SourceCode.mdimporter (which is there if you've installed the developer tools]] and show package contents
- Open Info.plist in (preferably) Property List Editor. Otherwise, you'll be editing XML in a text editor
- Add the following to Root->CFBundleDocumentTypes->0>LSItemsContentTypes
public.php-script
- Open Terminal and type
mdimport -r /Library/Spotlight/SourceCode.mdimporter
- After a while, when Spotlight finishes reindexing, you'll be able to search inside PHP files.
[edit]
Index c and c++ header files
- Open Terminal
- Type this:
mdimport -f /usr/include mdimport -f /usr/local/include mdimport -f /System/Library/Frameworks

