The Adventures of Systems Boy!

Confessions of a Mac SysAdmin...

Spotlight Revisited

See? Now this is what I'm talking about. Spotlight just doesn't work right. Now, I will admit, I've been using it a bit, and a couple times, over the past couple months, it's actually come in somewhat handy. But today, it lied. And I can prove it.

I was installing the nifty GoogleMaps plugin for Address Book. And I was looking around for the old GoogleMaps install, because, at least in the past, finding files whose names I knew on the filesystem was easier than reading a maunal. Lucky for me, today I got to do both. So, I open a Finder window, navigate to my home directory, and in the little search bubble thingy, I type these exact letters:

googlemaps



Now, I know that the letters "g-o-o-g-l-e-m-a-p-s" exist in the files I'm looking for, because I have the replacements right there in front of me. So when my search does not yield the files I want, I modify the search. In the same window's bubble-search thingy, I type:

BTgooglemaps



And now my files turn up.

Now wait. Doesn't "BTgooglemaps" contain the term "googlemaps"? So, shouldn't searching the latter yield the former? Yes, it should. In fact, if I just search "maps", I get my "BTgooglemaps" in the results, and lots of other crap, but not, for instance, my "com.briantoth.addressbook.googlemaps.plist", which does appear when searching "googlemaps".

This is just... Uh... How you say? Oh, right: Fucked.

If I can't trust my search engine to yield results that I know are there, then its usefulness is severly compromised. The old version of the Finder window search bubble was flawless at this. I used it all the time and it never failed me. And its functionality still exists somewhere in the Finder. We know this, because when we turn Spotlight off, the old functionality resumes. But for some reason, Apple has chosen to completely replace this functionality with a deeply flawed, and not always appropriate, method of searching: Spotlight.

Call me greedy, but I want both. I'll say it again: I want the old Panther-style, find-by-name in the Finder window toolbar search, and then I think I could live with Spotlight everywhere else. Although, in an ideal world, I would have preferences that let me define how each search method works: Finder window find, command-f find, Spotlight find. All these (or at least some of them) could (dare I say should) be configurable via preferences. And that would be sweet.

What we have right now is not sweet. It's a kludge.

Labels: ,

« Home | Next »
| Next »
| Next »
| Next »
| Next »
| Next »
| Next »
| Next »
| Next »
| Next »

2:53 PM

That's amazing. So filename isn't a metadata key!    



3:15 PM

I'm not sure how filename gets indexed, but I assume it is a metadata key. It looks to me like Spotlight's just buggy. But honestly, I don't know what's going on here, only that it's, as I mentioned, fucked.

Actually, from the looks of the mdls output, filename is a metadata key, so go figure. Funny that this plugin file is listed as kind="iDVD 2 Project":

kMDItemAttributeChangeDate = 2005-08-24 11:28:48 -0400
kMDItemContentCreationDate = 2005-08-23 17:11:15 -0400
kMDItemContentModificationDate = 2005-08-23 17:11:15 -0400
kMDItemContentType = "dyn.ah62d4qmuhk2x42xzr3wg23k"
kMDItemContentTypeTree = ("com.apple.package", "public.directory", "public.item")
kMDItemDisplayName = "BTGoogleMaps.bundle"
kMDItemFSContentChangeDate = 2005-08-23 17:11:15 -0400
kMDItemFSCreationDate = 2005-08-23 17:11:15 -0400
kMDItemFSCreatorCode = 0
kMDItemFSFinderFlags = 0
kMDItemFSInvisible = 0
kMDItemFSLabel = 0
kMDItemFSName = "BTGoogleMaps.bundle"
kMDItemFSNodeCount = 1
kMDItemFSOwnerGroupID = 501
kMDItemFSOwnerUserID = 501
kMDItemFSTypeCode = 0
kMDItemID = 648433
kMDItemKind = "iDVD 2 Project"    



5:14 AM

Without looking at the change log, I don't know if Spotlight has been updated much in the last year, but as of now it's working much more as anticipated. Putting "googlemaps" in the search field will always find my BTGoogleMaps files and folders. What's interesting is that just putting "maps" into the search field *doesn't* now find the .plist files, while entering "google" finds com.briantoth.addressbook.googlemaps24.plist, but *not* com.briantoth.addressbook.btgooglemaps.plist. However, if you select "filename" as one of the attributes and search for 'contains' "maps", both are found. This action is more comparable to the old Finder find command.

My guess is that Spotlight assigns a score to a string that occurs as part of a word in a filename, but not at the start, and isn't in the file's content (in the case of .plist files, content doesn't seem to be indexed anyway, as searching under the content attribute for stuff that I know is in a .plist file doesn't return any results). If that score isn't above a certain threshold, I imagine it's not included in the results list. If you find that searching on the filename attribute doesn't return files you know are there (except in folders like System which are apparently excluded from general searches), there definitely is a problem, though.

Overall I agree wholeheartedly that it would be good to have a choice of using the old Find scheme, which was blindingly efficient.    



12:45 PM

Yeah, Spotlight's definitely made some improvements over the last year. If nothing else, it's definitely speedier. But it's still not a search engine I trust 100%, the way the old-style Panther searches were. Frankly, if Spotlight doesn't find it, I keep looking, usually by hand. And that's a crappy way to search.

Guess there's always Leopard...

-systemsboy    



» Post a Comment