All Posts by Date or last 15, 30, 90 or 180 days.
also by Lloyd: diglloyd.com photography and WindInMyFace.com
Thank you for purchasing through links and ads on this site.
OWC / MacSales.com...
diglloyd Deal Finder...
Buy other stuff at Amazon.com...
Up to 1527MB/s sustained performance
128GB Memory in iMac 5K

Up to 128GB for 2019 iMac 5K!
Up to 64GB for 2015/2017 iMac 5K

Save nearly 50% over Apple pricing

Spotlight: Brain-Dead Search Priorities

Your author writes a fair amount of code in the Java programming language, and frequently uses Spotlight to open the desired “.java” source file.

So it’s maddening that Apple Spotlight chooses to present binary files as top picks over corresponding source files. For example, favoring “.class” files over “.java” (.class is a compiled .java file)—a useless and distracting behavior.

Spotlight also frequently prioritizes a filename found within an email or other file rather than the source file itself. So “HTMLRewriteFilter.java” buried in an email (or this web page!) is often prioritized in the list over the file itself. What sense does that make when there is an *exact* match on the file name?

It’s 2015 and it seems that all intelligent work on Spotlight has ceased, with the new Spotlight search dialog adding unhhelpful visual distractions and yet going backwards on useful behavior.

Moreover, the Spotlight preferences are a dumbed-down child’s version of something that might be useful if done properly. And so MPG is looking into a way to say “do not find or show .class files” and similar things, because the Spotlight search preferences are almost entirely useless (except for disabling entire classes of refuse).

Spotlight prioritizes binary compiled files over the source file

Attempting to help things along, Spotlight fails utterly: as shown, the file “HTMLRewriteFilter.java” exists and its type (kind) is obviously java (specifying “.java” fails the same way).

Specifying kind of “java” finds nothing (this file exists)

Chris R writes:

What also is really annoying with the new Spotlight is the inability to be able to move the actual Spotlight box around the screen once it’s opened!, it’s fixed so if, for example, you were copying a field from a box behind spotlight, you
have to close Spotlight down to view it!

MPG: I’d like it on my 2nd display. Apple golden rule: “Use not more than one display or drive or iDevice, or thou shalt be punished mightily in all behaviors small and useful, for The Apple believes in The One Shall Rule All Testing Protocols”.

John W writes with the suggestion to use:

For the Spotlight search you're attempting, it works much better to use the query:

name:HTMLRewriteFilter.java

This limits the search to filename metadata, versus the full metadata+contents index. That neatly avoids the false hits you describe, since those are all content-based hits (e.g. from emails, blog posts, etc.). Command-line (Terminal.app) users can perform this same search as:

mdfind -name HTMLRewriteFilter.java

Also highly relevant to developer workflow is mdfind's -onlyin flag, which limits the search to the specified directory.

MPG: this is a helpful suggestion. But it begs the question: if a filename matches exactly, why can’t Spotlight just work properly rather than always having to type "name:". For that matter why can’t there be some preferences or a checkbox or similar which remembers its state: why do I have to type "name:" 100 times a day? I created these aliases for use within Terminal

alias mdf="mdfind"
alias mdfh="mdfind name:.html"
alias mdfh.="mdfind name:.html -onlyin ."
alias mdfj="mdfind name:.java"
alias mdfj.="mdfind name:.java -onlyin ."

It’s a pity that such behavior cannot be set as a preferences in the GUI Spotlight search, or as pre-canned searches. Apple thought is only as deep as the skin of an Apple these days.

B&H Deal ZoneDeals by Brand/Category/Savings
Deals expire in 150 min unless noted. Certain deals may last longer.
$35 SAVE $115 = 76.0% Lowepro DroneGuard CS 400 in Video: Drones
$2797 SAVE $600 = 17.0% $246 FREE ITEMS Nikon Z 7 Mirrorless in Cameras: Mirrorless
$2798 SAVE $400 = 12.0% Sony a7R III Mirrorless in Cameras: Mirrorless
$3498 SAVE $1000 = 22.0% Sony a9 Mirrorless in Cameras: Mirrorless
$898 SAVE $100 = 10.0% $161 FREE ITEMS Sony DSC-RX100 VA in Cameras: Point and Shoot
$1879 SAVE $1071 = 36.0% ZEISS 15mm f/2.8 Distagon T* ZE in Lenses: DSLR

diglloyd.com | Terms of Use | PRIVACY POLICY
Contact | About Lloyd Chambers | Consulting | Photo Tours
Mailing Lists | RSS Feeds | Twitter
Copyright © 2019 diglloyd Inc, all rights reserved.
Display info: __RETINA_INFO_STATUS__