Spotlight Mac OS X Tips

Using Spotlight OS X Leopard yields the fastest searches out of all the previous versions. Arguably these improvements not only increase productivity but also help you find long lost files that you might have not realized you had.

1. Save a File Using Spotlight


When you are ready to save a file try using “Save As…” rather than performing a regular “Save”. When the Save dialog appears you will see that you can search for a related folder using the search field next to the current folder. This will save you time since you won’t have to save it to your desktop to sort later. This feature is not just limited to the Save function. Most Finder dialogues have the Spotlight search field visible.

2. Search Using Quotes


“” (Quotes) remains the best technique for searching keyword phrases. Simply put what you are looking for in quotes in the built in Spotlight tool in the upper right corner of your menu bar and it will constrain you search to a specific word combinations. This is most commonly used when you are looking for something specific.

3. Using “or”, “not”, “and”


Spotlight uses basic Boolean logic. What is Boolean? You were first introduced to it in second grade when you worked with grammatical conjunction to form compound sentences. These conjugations form truth-functions.

Example:
(a) The little dog laughed to see such fun.
(b) The dish ran away with the spoon.
(c) The little dog laughed to see such fun and the dish ran away with the spoon.

Obviously there are other words that can be used to conjugate “truth-functions”, but for the sake of simplicity I am sticking to the basics. Try expressing queries with single search terms joined with single words such as “or”, “not”, “if…then”. For Spotlight “and” is the default.

4. Unleash Spotlight’s Keyword Metadata Searches.


This is a more uncommon way of searching for people who are new to Mac OS X.

      1. Go to Spotlight in the Menu Bar
      2. Type the following kind:mov. (This will search for every movie “.mov” file on you hard drive. You can also try other media types such as mp3, pdf, doc.
      3. Try also name:. This command limits the search to just the file main and not the contents.
      4. Another cool option is the “created on” search. Type this as an example created:>1/1/09. This will find files that were created after January, 2009. The date search uses the following characters to find its results [ < > = ].

    5. Spotlight Photoshop Documents.


    Spotlight searching for a Photoshop document saved as PSD and created either in Photoshop Elements or in Photoshop CS will allow spotlight not only to search the file name itself but also its “Type” Layers. Make sure your “Type” layers are not rasterized, if they are they won’t be searchable.

    6. Skip Category Topics.


    I am sure when you have tried Spotlight that you wished it would be easier to skip categories topics. Using the Command + up/down

    7. Go Directly to a Selection


    Instead of clicking on a file that you have found and having it open using an application try this. Using Command + Return or Command + Click you can open the selected file in the Finder.


    8. Search ical


    For iCal event search you need to use the “kind” metadata tag followed by the application name “ical”

    kind:ical

    After this you will need to add the MM/DD/YY notation. This will search across all calendars as well as those ical subscribed ones. Ex: 06/7/09

    9. Search by Date


    You can also search for files based their creation date.

    date:[keyword]

    date:today [keyword] You can also use “today”, “yesterday” and “tomorrow”.

    10. Optimizing your Searches


    Spotlight indexes your hard drive and is capable of searching everything on within Leopard. Although the searches conducted using Spotlight are fast you will still need to set the search filters, which could slow things down. To select theses filters you want to do the following:

        1. Go to the Finder Menu > Apple > System Preferences.
        2. Click on Spotlight Preferences.
        3. Enable/disable some of the categories of your Spotlight search. This can be done by ticking/unticking the check boxes.

    Spotlight System Preferences


Macintosh Problems Finding Results

I recently came across two completely unrelated installations of Mac OS X 10.5.6 where Spotlight had failed to index any new searches and was either holding onto a previous index or contained nothing at all. If you’re encountering Mac Spotlight problems, you might find the following useful.

The two macs I was dealing with were a 24 inch iMac – Intel Core 2 Duo 2.93GHz with 4GB RAM and 640GB hard drive installed. Spotlight seemed to be working properly with the iMac. You could perform a search and find a file, BUT if the file was newer it would not find it. The other was a Xserve with two 2.66GHz Quad-Core Intel Xeon Nehalem with 3GB RAM, 160GB Hard Drive installed and had a Promise VTrak E-Class RAID subsystems attached via Fiber Channel. I installed this Xserve out of the box with Mac OS 10.5.5 installed and updated it to Mac OS 10.5.6. Once the XServe was configured I attached it to the Promise VTrak subsystems and began transferring the companies archive files to it. After this was complete I began searching with Spotlight to see if I missed anything. I found that spotlight worked locally on the first and second Hard Drive but failed when asked to search the Promise VTrak.


There are two ways of handling this type of problem, either through the System Preferences or Terminal. Before starting either option please remember to always REPAIR PERMISSIONS before starting. The System Preferences route is mainly for those who have not used Terminal before and want to use something that is already part of the Mac OS 10. Simply launch System Preferences and Click on Spotlight. Once open, click on the Privacy Tab and then on the “+” (plus) button and add the volume you are trying to index. Wait a few minutes (5-10) and select the volume again on the Privacy Tab and click on the “-” minus button to remove it again. This will force Spotlight to perform a clean re-index of the volume.

In both cases I used the mdutil command in Terminal to resolve the issue. If you are not familiar with mdutil, its the command used to manage the metadata stores of mounted volumes that are used by Spotlight. The mdutil options include:

-p Publish metadata.

-i (on|off) Turn indexing on or off.

-E Erase and rebuild index.

-s Print indexing status.

-a Apply command to all volumes.

-v Display verbose information.

To perform this command you will need to launch Terminal and type the following to turn off indexing:

username$ sudo mdutil -i off /Volumne
Password: (your password here)

With Terminal still open, type the following to get an index of the volume you are trying to repair spotlight on.

username$ cd/
(This gets you into the volumne structure)
username$ sudo ls
(This give you an index of all the hidden files on your Hard Drive)

You should see something similar to the following:

.DS_Store      Library      home

.Trashes      mach_kernel

.fseventsd       Shared Items      mach_kernel.ctfsys

.hotfiles.btree     System      net

.vol       Users      private

Applications      Volumes      sbin

bin      tmp      cores      usr

dev      var

Groups      etc

The two files you are after here are the .metadata_never_index and .Spotlight-V100. In one of my cases the .metadata_never_index was missing as in the example above. Don’t freak out if it is. The next two commands will remove these two files.

username$ sudo rm -r /.Spotlight-V100
username$ sudo rm .metadata_never_index

the sudo rm of the .metadata_never_index might return the following as mentioned about. Not to worry – that’s why we are working through these steps to get everything up and running again.

rm: .metadata_never_index: No such file or directory

Now let’s get everything back up and running. Type the following:

username$ sudo mdutil -i on /
/:
Indexing enabled.
username$ sudo mdutil -E /
/:
Indexing enabled.
username$ exit

That should do it. You will see the Spotlight icon in the upper right corner start pulsing a small dot in the center and if you click on it you can find out how long it will take to re-index.

Looking for something?

Use the form below to search the site:

Still not finding what you're looking for? Drop a comment on a post or contact us so we can take care of it!

Mac Users Guide Forum

    It Seem There Is Something Wrong With BBLD Configuration, Please Check It.