Jump to content

Odd file filter issue

Recommended Posts

I've rebuilt my index a few times, spotlight can find files just fine, and the Alfred Metadata Tool shows the correct info, so I *think* that means this is an Alfred issue. The File Search and File Filter in a workflow will only find files and folders that I've opened since installing Big Sur. If I haven't opened it, Alfred can't see it.


I tried clearing Alfred's learning knowledge, but that didn't make a difference.


Any other ideas?

Link to post

@dansherman Have you rebuilt your Mac's index?


  • First, please pop open System Preferences > Security & Privacy > Privacy > Full Disk Access and add Terminal
  • Once you've done this, go to Alfred's Advanced preferences, choose "Rebuild macOS Metadata"
  • Ensure that you check "Delete .Spotlight-V100 before reindex"
  • Follow the steps in Terminal, and keep a close eye for any error messages relating to your index. 

Please let me know if there are any errors. Otherwise, if it proceeds smoothly, you may need to wait up to an hour for the reindex to complete. Once this is done, type "reload" into Alfred to refresh the application cache, then make your searches again and see if your results are more as expected. :)


If your issue persists, could you give more details as to what files you're having trouble finding?



Link to post

I re-rebuilt the index and it still doesn't work. I'm specifically trying to find a folder, but searching for a file gives the same result. This happens in the default File Search as well as with File Filters in workflows. Other files and folders in this parent folder show up just fine if I've opened it since upgrading to Big Sur. 


This is the Alfred Metadata Tool result for a folder that does not show up in Alfred but does in spotlight:


Internal File Metadata

 Display Name: Forms
    Alt Names: 
    File Type: public.folder
    Last Used: 2020-10-23 12:58:42 +0000

Raw mdls File Metadata

_kMDItemDisplayNameWithExtensions      = "Forms"
kMDItemContentCreationDate             = 2018-11-14 19:10:34 +0000
kMDItemContentCreationDate_Ranking     = 2018-11-14 00:00:00 +0000
kMDItemContentModificationDate         = 2020-10-23 12:58:42 +0000
kMDItemContentModificationDate_Ranking = 2020-10-23 00:00:00 +0000
kMDItemContentType                     = "public.folder"
kMDItemContentTypeTree                 = (
kMDItemDateAdded                       = 2020-04-16 21:15:29 +0000
kMDItemDateAdded_Ranking               = 2020-04-16 00:00:00 +0000
kMDItemDisplayName                     = "Forms"
kMDItemDocumentIdentifier              = 0
kMDItemFSContentChangeDate             = 2020-10-23 12:58:42 +0000
kMDItemFSCreationDate                  = 2018-11-14 19:10:34 +0000
kMDItemFSCreatorCode                   = ""
kMDItemFSFinderFlags                   = 0
kMDItemFSHasCustomIcon                 = (null)
kMDItemFSInvisible                     = 0
kMDItemFSIsExtensionHidden             = 0
kMDItemFSIsStationery                  = (null)
kMDItemFSLabel                         = 0
kMDItemFSName                          = "Forms"
kMDItemFSNodeCount                     = 35
kMDItemFSOwnerGroupID                  = 20
kMDItemFSOwnerUserID                   = 501
kMDItemFSSize                          = (null)
kMDItemFSTypeCode                      = ""
kMDItemInterestingDate_Ranking         = 2020-10-23 00:00:00 +0000
kMDItemKind                            = "Folder"
kMDItemLastUsedDate                    = 2020-10-23 12:58:42 +0000
kMDItemLastUsedDate_Ranking            = 2020-10-23 00:00:00 +0000
kMDItemUseCount                        = 2
kMDItemUsedDates                       = (
    "2020-08-04 05:00:00 +0000",
    "2020-10-23 05:00:00 +0000"

 Is there any other information I can provide?

Link to post

I've done some more digging and running `mdfind -onlyin /Users/dansherman/clients -name Forms` also does not find the Forms folder. Actually, using `-onlyin /Users/dansherman` doesn't find it either. 


Even running `mdfind . -onlying /Users/dansherman/clients` only returns files and folders I've opened since upgrading to Big Sur. Which is useful in a way, but not most of the time.


Chalk this one up to a Spotlight bug I guess?

Edited by dansherman
Link to post

@dansherman Did you ensure you deleted the Spotlight V100 before starting your reindex? Looks like your index might still be incomplete or corrupted, as opening files essentially reindexes them individually, which would explain why you only see these previously-opened files.


Did you see any indexing errors in Terminal while going through the process of reindexing?

Link to post
Last login: Tue Jan 12 05:33:25 on ttys000
/Applications/Alfred\ 4.app/Contents/Frameworks/Alfred\ Framework.framework/Versions/A/Resources/reindexdel.sh ; exit;
(venv-dan) ➜  ~ /Applications/Alfred\ 4.app/Contents/Frameworks/Alfred\ Framework.framework/Versions/A/Resources/reindexdel.sh ; exit;

*                                                 *
*    This script will reindex your metadata by    *
*      firstly deleting .Spotlight-V100 then      *
*   running the command 'sudo mdutil -E -i on /'  *
*                                                 *
*         Indexing can take up to an hour         *
*     and Alfred won't work during this time.     *
*                                                 *
*   You can see the progress of the reindexing    *
*      by performing a search in Spotlight.       *
*                                                 *

Close this window to cancel, or press any key to continue...

Attempting to delete .Spotlight-V100...

rm: /System/Volumes/Data/.Spotlight-V100: Operation not permitted

Requesting metadata reindex...

	Indexing enabled. 

You can see the progress of the reindexing by performing a search in Spotlight

Press any key to finish...

Saving session...completed.

[Process completed]

I did rebuild the index and checked the V100 box. Looks there was an error deleting the V100. Do you have any suggestions on manually deleting it?



Link to post

Terminal was in the list of apps with Full Disk Access, but the box wasn't checked. I checked the box and ran the rebuild metadata tool again. This time there weren't any errors!


Index is taking a lot longer this time so I assume it's working correctly (last time indexing was done in less than two minutes).


Thanks for your patience!

Edited by dansherman
Missed a word.
Link to post

@Vero Things were great for a day or two but at some point the index seems to have been corrupted again and I'm having the same issue. I don't know if it's a Big Sur bug or something with Alfred, but I wanted to mention it here (for reference if nothing else). I'll re-index and see what happens.

Link to post

@dansherman Do you use any other third-party tools that may be manipulating your index? Some "app cleaners" that claim to run background processes to keep your Mac lean? If so, disable these as they're likely messing with your index, as you definitely shouldn't have to reindex your Mac every few days.


Nothing is changing in Alfred during these few days between your searches; the only thing that changes is the macOS metadata index either returning files to Alfred, or not returning files. If they are being returned to Alfred, he shows them, otherwise he doesn't know that the files exist.


Are the files you're searching for stored locally, or on iCloud/other sync service that may mean they're not always available locally? If it's the latter, then this may be playing a significant part in the files not being reliably index. 



Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Create New...