Jump to content

File filter not showing new files until I restart Alfred


Recommended Posts

I have a File Filter to look for specific file types in a specific folder.

 

If I create a new file in this folder that matches these requirements, then use the File Filter keyword to look for this new file, then the new file does not appear. I have to restart Alfred before the new file appears.

 

Yet, I can find the file just fine immediately in Spotlight and Alfred's normal file search.

 

What can I do so that I don't have to restart Alfred whenever I add a new file?

Link to comment

@Gary King You shouldn't need to restart Alfred for a file filter to start working. To clarify, does the file filter (placeholder) show in Alfred, but then no file results are returned when you type the query?

 

One interesting thing is that the macOS metadata index actually caches queries, and it can take a few moments for the differently formulated query syntax of Alfred's file filter to be interpreted and cached by macOS (it's usually instant). If you type your new file filter query, wait a few moments, hide Alfred, then re-show Alfred and re-type the same query, do you get results?

 

You could try doing a full reindex of your Mac (shortcut in Alfred's advanced preferences), which may flush out indexing issues such as this.

 

Cheers,

Andrew

Link to comment

@Gary King This sounds like a highly unusual and unexpected behaviour, so if you could provide answers to the few questions below, it might help work out what's happening on your Mac. :)

  • Can you please share your file filter first, so that I can take a look? (you can send me a link privately if you'd prefer not to share it with fellow users)
  • What file name and file type are you searching for? 
  • What's the exact query you type to search for it in Alfred outside of your file filter?
  • Is this the first file filter workflow you've created? If you use another file filter (existing or new), do search results appear as expected?

If you can think of anything else out of the ordinary either with your Mac and its data, or the files you're searching for, do let me know so that we can work out what's happening :)

 

Cheers,
Vero

Link to comment
  • 1 month later...
  • 1 year later...

Hello! After several years, I still have this problem.

 

I've run `mdls` to inspect one file that does not appear in a File Filter, and another that does.

 

The file type I'm filtering for, in the File Filter, is `dyn.ah62d4rv4ge80g55eqy01s55wrr31a2pdqy` (which corresponds to the file extension of `.code-workspace` for VS Code workspace files).

 

The `mdls` output for a file that appears in the results is:

 

kMDItemContentCreationDate         = 2018-03-26 01:00:14 +0000
kMDItemContentCreationDate_Ranking = 2018-03-26 00:00:00 +0000
kMDItemContentModificationDate     = 2019-11-11 20:35:24 +0000
kMDItemContentType                 = "dyn.ah62d4rv4ge80g55eqy01s55wrr31a2pdqy"
kMDItemContentTypeTree             = (
    "dyn.ah62d4rv4ge80g55eqy01s55wrr31a2pdqy",
    "public.data",
    "public.item"
)
kMDItemDateAdded                   = 2018-03-26 01:00:14 +0000
kMDItemDateAdded_Ranking           = 2018-03-26 00:00:00 +0000
kMDItemDisplayName                 = "Project.code-workspace"
kMDItemFSContentChangeDate         = 2019-11-11 20:35:24 +0000
kMDItemFSCreationDate              = 2018-03-26 01:00:14 +0000
kMDItemFSCreatorCode               = ""
kMDItemFSFinderFlags               = 0
kMDItemFSHasCustomIcon             = (null)
kMDItemFSInvisible                 = 0
kMDItemFSIsExtensionHidden         = 0
kMDItemFSIsStationery              = (null)
kMDItemFSLabel                     = 0
kMDItemFSName                      = "Project.code-workspace"
kMDItemFSNodeCount                 = (null)
kMDItemFSOwnerGroupID              = 20
kMDItemFSOwnerUserID               = 501
kMDItemFSSize                      = 377
kMDItemFSTypeCode                  = ""
kMDItemInterestingDate_Ranking     = 2020-02-15 00:00:00 +0000
kMDItemKind                        = "Visual Studio Code - Insiders document"
kMDItemLastUsedDate                = 2020-02-15 18:27:26 +0000
kMDItemLastUsedDate_Ranking        = 2020-02-15 00:00:00 +0000
kMDItemLogicalSize                 = 377
kMDItemPhysicalSize                = 4096
kMDItemUseCount                    = 598
kMDItemUsedDates                   = (
    "2020-02-15 05:00:00 +0000"
)

 

And the output for one that doesn't appear in the results is:

 

kMDItemFSContentChangeDate = (null)
kMDItemFSCreationDate      = (null)
kMDItemFSCreatorCode       = ""
kMDItemFSFinderFlags       = (null)
kMDItemFSHasCustomIcon     = (null)
kMDItemFSInvisible         = 0
kMDItemFSIsExtensionHidden = (null)
kMDItemFSIsStationery      = (null)
kMDItemFSLabel             = (null)
kMDItemFSName              = (null)
kMDItemFSNodeCount         = (null)
kMDItemFSOwnerGroupID      = (null)
kMDItemFSOwnerUserID       = (null)
kMDItemFSSize              = (null)
kMDItemFSTypeCode          = ""

 

Clearly something is wrong here! But is there anything that I, or Alfred, can do about this? The latter file appears file in a normal file search, in both Spotlight and Alfred. But it doesn't appear in the File Filter, since I'm filtering for a something type of file, and apparently, even though this file has the correct file extension (.code-workspace), it doesn't have the correct metadata.

 

The weird thing is, after 10 minutes, the metadata gets populated for the file. But of course, I'd like to be able to create a file, and access it in Alfred, immediately.

Edited by Gary King
Link to comment
7 hours ago, Gary King said:

The weird thing is, after 10 minutes, the metadata gets populated for the file.

 

It sounds like the metadata indexer is running a bit slow on your machine. Presumably, it's not showing up in the File Filter immediately because you're filtering by filetype, but the the file's type isn't available until it's indexed.

Link to comment
8 hours ago, deanishe said:

 

It sounds like the metadata indexer is running a bit slow on your machine. Presumably, it's not showing up in the File Filter immediately because you're filtering by filetype, but the the file's type isn't available until it's indexed.

 

Have you ever seen a case like this before? Is there anything I can do about it? I have a decently powerful Mac, considering its age of a few years. It's got an i7 CPU, 16 GB of RAM, and an SSD. This issue I'm experiencing happens every time I create a new .code-workspace file; the metadata seems to take a few minutes to populate.

 

The issue is related to waiting for Spotlight to provide metadata for new files, right? I just created a new text file, and I checked its metadata 1 second later; there's no metadata. But 2 seconds later, there's metadata. So that seems fine. But if I do the same with a .code-workspace file, then it still takes a few minutes to populate its metadata. Is there something wrong with this particular type of file? How would I fix that?

 

 

Edited by Gary King
Link to comment
1 minute ago, Gary King said:

Have you ever seen a case like this before?

 

I think everybody has problems with the indexer from time to time. You can try rebuilding the index from Alfred Preferences > Advanced > Rebuild macOS Metadata.

 

Be warned: it usually takes a few hours and search (in Spotlight, Alfred and other apps) won't work properly till it's done.

Link to comment

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...