Take the 2-minute tour ×
Ask Different is a question and answer site for power users of Apple hardware and software. It's 100% free, no registration required.

Since spotlight continuously updates the index, sometime the file precedence gets changed around and I might type in "saf" and press return expecting to get Safari, but instead spotlight attempts to open some Java jar file.

Question Is there any way to make spotlight ignore certain file types or directories?

share|improve this question
    
More here superuser.com/questions/117325/… –  user21134 Apr 3 '12 at 13:06
add comment

2 Answers

up vote 2 down vote accepted

Short answer: yes.

Go to your System Preferences, then Spotlight:

Spotlight Preference Pane

You can disable and/or reorder the items in this list. By dragging Applications to the top, "Saf" will match Safari first (because it's an App, regardless of it's location).

If, on the other hand, there's a Folder(s) or Drive(s) that you want to explicitly exclude from Spotlight until you change your mind, turn onto the Privacy Tab (on top of that panel) and click the (+) button to browse for a folder.

Spotlight Privacy Pane

This window also accepts Drag and Drop of Folders or Drives (Volumes). In my Sshot, you can see that I exclude Clone (my weekly clone drive) from Spotlight so when I search for something I don't come up with duplicated results (one from the main drive and one from the backup).

I also have added a Public Folder where a lot of ppl drops stuff and I don't care about it nor I want it in my search results.

If you want to restore it, you can always remove it from this list (and give spotlight time to re-index it).

You can't (as far as I know) exclude by File type.

Note: in order to drag a "drive" just go go the finder, click on your Mac OS Volume and then press ↑ (the up arrow) to go back to the "root", you will see your volumes there (among other things). Drag it and drop it onto this Privacy tab and voilá.

share|improve this answer
add comment

While Martín is correct that you can prioritise applications to the top of the results, unfortunately JAR files seem to be considered as applications by Spotlight. I've not found a way to deal with this, but you can use Martín's other information to exclude large collections of JAR files (e.g. Maven repositories, installations of Eclipse, etc) which would lessen the number of JAR results appearing when you really want a genuine application.

Cheers,

Maurice

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.