Tips for using spotlight with webpages served via https

bookmarksbrowser-historysafarisearchspotlight

I've started using spotlight with webpages today. It will actually index the content of web pages in your history and bookmarks. It's great. But I can't find any documentation on how to use it.

My understanding is spotlight doesn't index URLs that start with https:

One of the main wikis that I use has all pages behind https:, so I would very much like to change this.

  • Is there any way to get "mdfind" to spit out spotlight results for items other than files? (UPDATE: Thanks bmike, I looked more carefully on my system, and I see the bookmarks now.)
  • Are there any other tips or tricks I should know for using spotlight better with https and/or normal web pages?

Best Answer

I can't help you with the main thrust of how to index ssl content, but will take an attempt at the learning mdfind commands.

The man page for mdfind is thin, but shows you that you can search on anything that is classified. In your case, try a mdfind command to get some web history results - for me, this command shows several files Safari has squirreled away for spotlight to index.

mdfind stackexchange | grep Safari | grep History | head

From there, you can use mdls to pick apart what terms you might want to feed back into mdfind:

mac:Users mike$ mdls /Users/mike/Library/Caches/Metadata/Safari/History/http:%2F%2Fapple.stackexchange.com%2Fquestions%2F25487%2Flock-screen-with-launchbar.webhistory | tail
kMDItemFSName                  = "http:%2F%2Fapple.stackexchange.com%2Fquestions%2F25487%2Flock-screen-with-launchbar.webhistory
kMDItemFSNodeCount             = 14147
kMDItemFSOwnerGroupID          = 20
kMDItemFSOwnerUserID           = 501
kMDItemFSSize                  = 14147
kMDItemFSTypeCode              = ""
kMDItemKind                    = "Safari history item"
kMDItemLogicalSize             = 14147
kMDItemPhysicalSize            = 16384
kMDItemURL                     = "http://apple.stackexchange.com/questions/25487/lock-screen-with-launchbar"

A few tags that might be of immediate use to you are kMDItemContentType, kMDItemFSName, and kMDItemURL

You can see my mac has processed several hundred items with a URL that begins with https:

mac:Users mike$ mdfind "kMDItemURL == 'https:*'" | wc -l 
    353