Apple introduced Spotlight as a powerful way to search file metadata in OS X 10.4 Tiger. With the release of OS X 10.5 Leopard, there have been many updates to this application that allow you to do things more advanced than just search. This article shows you how to make use of Spotlight's more advanced features. This article applies to OS X 10.5 and later.
Using Keywords to Search
Spotlight now understands phrases in parentheses.
"chocolate chip cookies" returns only results with the words chocolate chip and cookies in a row.
Searching on chocolate chip cookies would return results with any of the words chocolate, or chip, or cookies.
You can also do partial word searches with asterisks as wildcards.
Example to find the words "black", "blackbird", and "blacksmith" use black*
You can also use wildcards to search by file extension.
Example *.mp3 will find all the mp3 files on your harddrive.
Using Boolean Searches
Use "OR" and "NOT" in your search requests. This will greatly cut down on the number of irrelevant matches that you receive.
To use OR use the straight up and down line "|".
Example cats|dogs returns results mentioning either cats or dogs.
To use NOT use the "-" sign.
Example cats(-dogs) will return results that mention cats, but not dogs.
Perform calculations right in spotlight. With over 40 functions built in you can find out what 42 * 54 is without needing to open the Calculator Application.
Type in a word into spotlight. One of the top results will be a definition of the word.
Searching System files
In Tiger, Spotlight did not search system files by design. In Leopard you can now search through the System files on your Mac.
While Spotlight now narrows things down nicely, you may still see multiple results. One good way to see if you have the right file is to open a searching window, perform your search, and select the file you believe you want to open and press the Space Bar. This engages Leopard’s Quick Look feature. Quick Look lets you quickly scan through the contents of a file, without forcing you to go to the trouble of opening it in its native application.
Search Shared Macs
If you have multiple macs that you have access too that are on the same network, you can search them all by filename, contents or metadata. You can search any Mac on the same network that you have permission to access that has Personal File Sharing enabled.
Launch Applications through Spotlight
In Leopard, applications are now at the top of the search results, press Return on the search result to open the application.
Web History Search
Search your recently visited web pages with Spotlight. Spotlight indexes the names of the websites you have visited as well as the content in the sites themselves. Search any attribute of a recently visited web page and you can go right back to it in Safari.