Jump to content

Alfred won't find a folder but then it suddenly does


Recommended Posts

I'd like to file this as a bug report, but since I can't (haven't tried to) reproduce this, I'll just submit it here as a question/ observation.

 

Generally, I'm having trouble getting Alfred to find all my files and folders, but I know that this is not a problem with Alfred but with Spotlight, especially when it comes to indexing files on a Samba share. The problem I'm describing here does not involve Samba, but chances are that it is nevertheless a problem with Spotlight. But I hope to get some help with it anyway.

 

The following happens occasionally when I search for a file name or folder that I know exists but Alfred just won't show it in the search results. I then use GoToFile to locate it (if GoToFile were a bit faster and if I could get my muscle memory to switch to a different shortcut for file searches, I'd always use GoToFile). Today I searched for a folder called "Voluntas", a unique name that doesn't show up anywhere else on my system, no file or folder has it as a component of its name. Alfred did not find it. GoToFile did without issues. I then dropped a file from that folder into the Alfred Troubleshooting modal to see why the search failed. But the result was all green:

 

File cache integrity is ok

Alfred has permissions to read this file.

Indexing is enabled on this drive

Direct metadata available

Metadata contains required items

File exists within Alfred's default search scope

macOS returned a match for this file in your search scope.

Troubleshooting passed
 

So, I opened Alfred again and searched for Voluntas and this time it found it. 

 

I have no idea how this is possible.

 

You may think: "You made a typo the first time you searched." I'm confident to say that I did not because I checked. But even if I still spelt Voluntas wrong, the same problem exists with the parent folder ("reviews"). This was actually the first folder I search for but since Alfred showed me various files and folders containing "reviews" it did not show me the folder containing the voluntas folder. That's why I then searched for a more unique folder name, just to make sure that I'm not missing the result in the list of non-relevant results.

 

My best explanation for this behaviour is that the folder got indexed because I accesses it.

 

But why wasn't it indexed before? The folder has existed for several years and while I have not accessed it for years, I would expect it to remain indexed.

 

Is this just another example of Spotlight being very unreliable in doing its job? How do people deal with this? Finding files is one of the most basic and most important things we do on a computer and yet macOS is not able to do it properly? I'm still hoping that I missed something and when I fix that, it will work...

 

 

Link to comment

@Toffy Would you be able to paste the full troubleshooting for a file with which you've had issues? Or at the very least provide the path where it's stored?

 

The more information we have, the more likely we can give you pointers in the right direction. For example, if the files in question are part of folders that iCloud or a third-party sync service might move to online-only storage, etc this may affect how Spotlight indexes them. 

 

Link to comment

Here is the full troubleshooting file, I only modified the file name for reasons of confidentiality. The modification consisted of replacing numbers with other numbers.

 

I am aware of the problems that "online-only" storage can cause, which is why I have this feature disabled, both on iCloud and on Dropbox. Selective Sync is also disabled.

 

 

Quote

Starting Diagnostics...

File: 'VOLU-D-00-00000_R1.pdf'
Path: '/Users/christoph/Library/CloudStorage/Dropbox/Papers/my reviews & comments/Voluntas/first resubmission'

-----------------------------------------------------------

Check file cache database...

File cache integrity is ok

-----------------------------------------------------------

Check if file is readable...

Alfred has permissions to read this file.

Unix Permissions: 420
Underlying Type: NSFileTypeRegular
Extended Attributes: (
    "com.dropbox.attrs"
)

-----------------------------------------------------------

Check if volume '/' is indexed by macOS...

Indexing is enabled on this drive

-----------------------------------------------------------

Check direct file metadata...

Direct metadata available

Display Name: VOLU-D-00-00000_R1.pdf
 Other Names: 
Content Type: com.adobe.pdf
   Last Used: 

-----------------------------------------------------------

Check mdls file metadata...

Metadata contains required items

_kMDItemDisplayNameWithExtensions  = "VOLU-D-00-00000_R1.pdf"
kMDItemAuthors                     = (
    19
)
kMDItemContentCreationDate         = 2017-11-13 16:59:49 +0000
kMDItemContentCreationDate_Ranking = 2017-11-13 00:00:00 +0000
kMDItemContentModificationDate     = 2017-11-13 16:59:49 +0000
kMDItemContentType                 = "com.adobe.pdf"
kMDItemContentTypeTree             = (
    "com.adobe.pdf",
    "public.data",
    "public.item",
    "public.composite-content",
    "public.content"
)
kMDItemDateAdded                   = 2021-04-17 08:41:54 +0000
kMDItemDisplayName                 = "VOLU-D-00-00000_R1.pdf"
kMDItemDocumentIdentifier          = 81874
kMDItemEncodingApplications        = (
    "iTextSharp\U2122 5.5.9 \U00a92000-2016 iText Group NV (AGPL-version)"
)
kMDItemFSContentChangeDate         = 2017-11-13 16:59:49 +0000
kMDItemFSCreationDate              = 2017-11-13 16:59:49 +0000
kMDItemFSCreatorCode               = ""
kMDItemFSFinderFlags               = 0
kMDItemFSHasCustomIcon             = (null)
kMDItemFSInvisible                 = 0
kMDItemFSIsExtensionHidden         = 0
kMDItemFSIsStationery              = (null)
kMDItemFSLabel                     = 0
kMDItemFSName                      = "VOLU-D-00-00000_R1.pdf"
kMDItemFSNodeCount                 = (null)
kMDItemFSOwnerGroupID              = 20
kMDItemFSOwnerUserID               = 501
kMDItemFSSize                      = 791571
kMDItemFSTypeCode                  = ""
kMDItemInterestingDate_Ranking     = 2017-11-13 00:00:00 +0000
kMDItemKind                        = "PDF document"
kMDItemLogicalSize                 = 791571
kMDItemNumberOfPages               = 33
kMDItemPageHeight                  = 792
kMDItemPageWidth                   = 612
kMDItemPhysicalSize                = 794624
kMDItemSecurityMethod              = "None"
kMDItemVersion                     = "1.6"

-----------------------------------------------------------

Check file is in search scope...

File exists within Alfred's default search scope

-----------------------------------------------------------

Check MDQuery file search...

macOS returned a match for this file in your search scope.

File Search Results for search scope (
    "[0] /System/Volumes/Data/Users/christoph/Library/CloudStorage/Dropbox/Papers/my reviews & comments/Voluntas/first resubmission/VOLU-D-00-00000_R1.pdf"
)

File Search Results for ~/ (
    "[0] /System/Volumes/Data/Users/christoph/Library/CloudStorage/Dropbox/Papers/my reviews & comments/Voluntas/first resubmission/VOLU-D-00-00000_R1.pdf"
)

File Search Results for / (
    "[0] /System/Volumes/Data/Users/christoph/Library/CloudStorage/Dropbox/Papers/my reviews & comments/Voluntas/first resubmission/VOLU-D-00-00000_R1.pdf"
)

-----------------------------------------------------------

Troubleshooting passed


 

Link to comment

@Toffy Thanks for the details. Could you please open your Alfred preferences to the Default Results, click the "Reset..." button bottom right of the search scope and set it to Full Disk? If you search for the file, can you now find it? 

 

Summarising a past macOS bug, some users who upgraded their Mac / set up a new one by using the macOS Migration Assistant encounter a scope issue where macOS doesn't correctly resolve the paths from the old Mac to the new one. Setting the scope to Full Disk usually works around that bug. It's been much less frequently reported recently, so I can only surmise that Apple has fixed it in some contexts but not all.

 

Some users reported that this scope issue was resolved by fully reindexing their Mac, so if you have a moment, that's also a good option.

 

Let me know how you get on :)

Link to comment

Thanks for your assistance. I'm glad that this may have been an issue with Alfred and not with Spotlight (which would probably have been much more difficult to resolve). 

 

1 hour ago, Vero said:

If you search for the file, can you now find it? 

 

Unfortunately, that doesn't work as a test because I was already able to find it before making those changes. That is the tricky thing with troubleshooting this issue:

 

1. I search a file but Alfred doesn't find it. 

2. I find it using GoToFile (sometimes I even manage to retrieve the location from my brain!)

3. Since I already wasted my time trying to find the file, I rarely want to investigate the issue more, but when I do, like today, Alfred troubleshooting often fails to find a problem and I had the impression that it was due to me navigating to the file, that some forgotten part of the index got reactivated. Previously, I tended to doubt my memory (also because this reactivation theory is nonsense). Did I really search for the correct term? Did I get too many hits and failed to search through them all? etc. There are many ways humans err and if I can, I try to blame it on the human rather than the machine. But this time it was different (as explained in the OP). There was no way of blaming it on the user.

 

So. let's hope that the full disk access fixed it (although I didn't migrate or upgrade other than the regular macOS updates).

 

Just one question: does full disk also include everything mounted under /Volumes (like external drives and network Volumes) or do I need to re-add those separately?

 

Oh, and while I'm at it: another thing that keeps bugging me is that whenever I search for a folder named "IR" (the name of a committee on which I sit), Alfred presents me a long list of Zotero storage folders (which are named with random combinations of letters and numbers) that happen to contain the letters IR. Strictly speaking, it's not wrong to present IR6G6NM7 and VMV7R4IR as hits for that search ...

AlfredPreferences-2023-06-19at19_21.00@2x.png.61380b99c0c19031cc00fdc367fe0861.png

 

but when there is a folder that matches the search string 100%, I see no reason why it would not be placed at the top of the search results. I think it's called "Levenstein similarity" or something like that. Doesn't Alfred use that?

 

I have to say, when I just tried the search the results looked better than before. It was not just Zotero storage folders, but the actual IR folder was still ranked #9. So perhaps the all-disk thing also contributed some improvement to that thing, but the basic question remains: why doesn't the exact match not show up on top of the list? I tried disabling Fuzzy search (although I appreciate it otherwise), but the results are identical.

 

 

 

Link to comment

 

21 hours ago, Toffy said:

I'm glad that this may have been an issue with Alfred and not with Spotlight

 

@Toffy Thanks for taking the time to provide more details. To be clear, this is an issue with macOS, not with Alfred, so these are workaround in Alfred given Apple hasn't, and likely won't, resolve the deeper-rooted issue.

  • Which version of macOS are you using?
  • Did you install it fresh or do an upgrade / use Time Machine / Migration Assistant to copy your stuff from an older Mac?

With regards to exact matching "IR", have you ever searched for the folder in question and selected it when using that keyword? If so, Alfred will match it as a higher priority above random folders that contain the same characters. You can read more about Alfred's Knowledge and result ordering here:

https://www.alfredapp.com/help/kb/understanding-result-ordering/

 

Link to comment
On 6/20/2023 at 5:35 PM, Vero said:
  • Which version of macOS are you using?
  • Did you install it fresh or do an upgrade / use Time Machine / Migration Assistant to copy your stuff from an older Mac?

 

I'm am the latest version of Ventura. I did not do a fresh install or any migration in the past two years but I install the macos updates as they come. I use TimeMachine to back up but so far never needed to restore anything (fingers crossed).

 

On 6/20/2023 at 5:35 PM, Vero said:

With regards to exact matching "IR", have you ever searched for the folder in question and selected it when using that keyword? If so, Alfred will match it as a higher priority

 

Yes, I read about that, but that is not the behaviour I'm seeing. I open that folder about once a month and I never open any of those Zotero folders but they still rank higher. 

 

Maybe the problem is that even though I definitely open the IR folder regularly, I may not be doing so by directly clicking on a search result, for the simple reason that there is no search result to click on (because the Zotero folders as well as some other folders containing IR are ranked higher and the number of hits is limited). So it's a vicious circle...

 

While that looks like a convenient explanation, I'm not sure this is the whole story because I believe that I at some point somehow did get the IR folder in the search results and clicked on it. That single click should have been enough to make sure it ranks top in any future search...

 

But putting the above aside for a moment: wouldn't you agree the an exact match should always rank higher than a partial match (all else equal)? I think the fact that this is currently not the case is the core of the problem. 

 

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