Spotlight has a quirk that I want to fix, if possible. When I search for certain keywords, such as categories in System Preferences, Spotlight will place a document as the "Top Hit" in the search results, even though System Preferences have a higher priority over Documents in Spotlight's preferences. I want to be able to blacklist certain filetypes while preserving the "Documents" category.
For example, typing "sharing" will return the top hit as "sharing.qml" from the Qt5.1.1 directory, followed by Sharing in System Preferences. I can't then immediately press enter to open "Sharing" without first pressing the down arrow.
What I am able to do to fix this individual issue is blacklist the Qt5.1.1 examples
directory.
You can see that it returns "sharing.html" from the gtk-doc directory now. So I blacklist that directory as well.
Now I am able to search for "Sharing" with no issues. However, there are other search results that exhibit similar behavior, such as when typing "mouse". It is too tedious to block each directory that I find.
I want to be able to blacklist individual filetypes from Spotlight. I have set "System Preferences" to have a higher priority than "Documents" in Spotlight as well. Nothing seems to affect the "Top Hit" other than individually blacklisting each directory that holds a file that I don't want to see.
Is there a better way?
Best Answer
Find the importer used to import that type of file.
The above example shows the type as public.png in the Image.mdimporter importer.
Open
/path/to/importer/Contents/Info.plist
in an editor.Find the item of the same type as the type of the file that you found from the above command and delete it.
Reimport the importer.
Don't forget to have backups and note this procedure may be overridden on OS X updates.