Jump to content
Pennyworth

How to disable Spotlight/Alfred searching inside packages?

Recommended Posts

I know Alfred uses the Spotlight index to power its search results, so my question is:

 

How can I disable Spotlight from indexing the content of package files, particularly iPhoto or iTunes library files?

 

The contents of these packages/libraries are cluttering up my Alfred results like no body's business. It's basically making Alfred dysfunctional for searching files and folders. I'm getting all kinds of irrelevant results with long strings of random characters (because that's how package/library data is named).

 

It's really impacting my experience and I want to fix it ASAP. Thanks community for any advice you have.

 

Screenshots below:

 

eNrIjIr.png

 

VITKdeH.png

Share this post


Link to post

Tyler, The problem is that by adding certain files to the Spotlight Privacy blacklist, I'm no longer able to search for them!

 

For example, I have two iPhoto libraries on an external hard drive. I also have two on my internal disk. Currently, the contents of the external libraries are indexed by Spotlight (as are the main library files themselves, so I can open them in iPhoto). When I add the two external libraries to the Spotlight Privacy blacklist, their garbled contents no longer clutter my search results. This is great. At the same time, I'm no longer able to quickly access these iPhoto libraries through search results! Confusingly, the iPhoto libraries on my internal drive do not have their package contents clutter up search results, they just appear as opaque files (which is the desired behavior). Something just seems off about all this.

Edited by Pennyworth

Share this post


Link to post

Hmmm…

 

This sounds like a metadata problem. Is your external drive formatted as "Mac OS Extended"? You can find this out by right clicking the drive in Finder, choosing "Get Info", and looking for the "Format" entry.

Image%202014-09-16%20at%208.21.46%20AM.j

 

If this isn't the problem, I can't be of much help :(. Maybe another forum member will have something better to say.

Share this post


Link to post

Yes, it's Mac OS Extended (Journaled). I'm also running 10.9.4. I should also disclose that I've manually added to Alfred's 'Search Scope' list the folder in which those iPhoto library packages are located. I didn't know of another way to incorporate them into my results. They're on an external drive connected via USB. This must have something to do with it.

Edited by Pennyworth

Share this post


Link to post

I can confirm now that something is definitely wrong with how Spotlight/Alfred indexes iPhoto library packages on internal vs. external drives. These library packages are "opaque" on the internal drive. That is to say, you can't see inside them in search results (expected behavior). On my external drive, these packages are transparent, so you can see all their garbled garbage. Also, on the same external volume, I cannot search inside iMovie library packages (expected behavior). So something about iPhoto library packages on an external drive is off. I don't know why this is or how to turn it off but help would be much appreciated.

Edited by Pennyworth

Share this post


Link to post

I can confirm now that something is definitely wrong with how Spotlight/Alfred indexes iPhoto library packages on internal vs. external drives. These library packages are "opaque" on the internal drive. That is to say, you can't see inside them in search results (expected behavior). On my external drive, these packages are transparent, so you can see all their garbled garbage. Also, on the same external volume, I cannot search inside iMovie library packages (expected behavior). So something about iPhoto library packages on an external drive is off. I don't know why this is or how to turn it off but help would be much appreciated.

 

As far as I'm aware, OS X shouldn't be indexing inside this package in this way, regardless of location. Have you tried forcing a full reindex on that drive using the "Rebuild OS X Metadata" shortcut in Alfred's Advanced preferences? (select the option to delete the ./Spotlight-V100 folder too)

 

Cheers,

Andrew

Share this post


Link to post

As far as I'm aware, OS X shouldn't be indexing inside this package in this way, regardless of location. Have you tried forcing a full reindex on that drive using the "Rebuild OS X Metadata" shortcut in Alfred's Advanced preferences? (select the option to delete the ./Spotlight-V100 folder too)

 

Cheers,

Andrew

 

I forced a reindex of the drive by adding it to the Spotlight Privacy exclusion list and then removing it -- but it didn't help. (Sidebar: is this different from Alfred's metadata rebuilder?) What finally worked was that I right-clicked the libraries, selected 'Show Package Contents', and manually added the contents to the Privacy exclusion list. This works better than simply adding the library to the exclusion list because I wasn't able to search and access just the library with that workaround, but now I can. For now, problem solved, but I suspect there's some kind of bug with iPhoto library packages. Hopefully Photos.app in Yosemite fixes a lot of these oddities.

Edited by Pennyworth

Share this post


Link to post

I forced a reindex of the drive by adding it to the Spotlight Privacy exclusion list and then removing it -- but it didn't help. (Sidebar: is this different from Alfred's metadata rebuilder?) What finally worked was that I right-clicked the libraries, selected 'Show Package Contents', and manually added the contents to the Privacy exclusion list. This works better than simply adding the library to the exclusion list because I wasn't able to search and access just the library with that workaround, but now I can. For now, problem solved, but I suspect there's some kind of bug with iPhoto library packages. Hopefully Photos.app in Yosemite fixes a lot of these oddities.

 

If you add to spotlight privacy and back out again, this won't fix underlying issues vs deleting the .Spotlight-V100 folder which removes all index data and rebuilds from scratch.

Share this post


Link to post

If you add to spotlight privacy and back out again, this won't fix underlying issues vs deleting the .Spotlight-V100 folder which removes all index data and rebuilds from scratch.

 

I deleted the .Spotlight-V100 folder on the external drive and added/removed the drive from Spotlight Privacy to re-index. It still didn't work. Should I be using Alfred's "Rebuild OS X Metadata"? Is that any different from doing what I did?

Share this post


Link to post

I deleted the .Spotlight-V100 folder on the external drive and added/removed the drive from Spotlight Privacy to re-index. It still didn't work. Should I be using Alfred's "Rebuild OS X Metadata"? Is that any different from doing what I did?

 

Yes, as Andrew has already explained, you need to rebuild the OS X metadata properly. Go to Alfred's Advanced preferences, click "Rebuild OS X Metadata" and check the box to delete .Spotlight-V100. :)

Share this post


Link to post

Yes, as Andrew has already explained, you need to rebuild the OS X metadata properly. Go to Alfred's Advanced preferences, click "Rebuild OS X Metadata" and check the box to delete .Spotlight-V100. :)

 

I did that, and as expected, the .Spotlight-V100 folder on the external drive was not touched by this process. It only indexed the main system drive, which is not where the problem lies. I know this because I enabled hidden files to be shown and watched what happened in the root directories of both drives once I started the rebuild process.

 

My file search results still include the contents of iPhoto Library packages. This isn't a Spotlight issue, this is something else relating to these iPhoto Library packages on the external drive. The current remedy is to manually add the package contents to the Spotlight privacy exclusion list. It's a hack, but it works.

Share this post


Link to post

I did that, and as expected, the .Spotlight-V100 folder on the external drive was not touched by this process. It only indexed the main system drive, which is not where the problem lies. I know this because I enabled hidden files to be shown and watched what happened in the root directories of both drives once I started the rebuild process.

 

My file search results still include the contents of iPhoto Library packages. This isn't a Spotlight issue, this is something else relating to these iPhoto Library packages on the external drive. The current remedy is to manually add the package contents to the Spotlight privacy exclusion list. It's a hack, but it works.

 

 

You might try using a workflow I made to reindex your external drives:

Download

 

Open Alfred, type "force reindex ", then choose the drive that's giving you problems. Once you hit enter, AppleScript will ask for your administrator password. It will then execute the following commands (used by Andrew and found originally at SkillZ Design, before Alfred's handy "Rebuild OS X Metadata" button appeared) :

sudo rm -R /Volumes/{Drive Name}/.Spotlight-V100
sudo mdutil -i on /Volumes/{Drive Name}/
sudo mdutil -E /Volumes/{Drive Name}/

This will delete the existing metadata index on the drive and force mdutil (Spotlight's backend) to rebuild the metadata.

 

Note that reindexing can take a significant amount of CPU power and several hours.

Share this post


Link to post

You might try using a workflow I made to reindex your external drives

 

Tyler, thanks so much for your help and linking to that workflow. I gave it a shot and it still didn't solve the problem, despite successfully rebuilding the external drive's spotlight index (unlike the Alfred Metadata Rebuild button). That means this is a problem with the specific library packages I'm dealing with. iPhoto's been neglected by Apple for so long that I'm hoping the new Photos.app in Yosemite will fix this.

Share this post


Link to post

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...