Jump to content

Alfred can not find some files while spotlight can


Recommended Posts

Hi,

I am using Alfred 4.3.3 on macOS Big Sur 11.2.3

My Alfred cannot find some files recently, previously it worked perfectly.

Those files are inside a folder that is synced by Dropbox or OneDrive. All the files are stored locally, spotlight can find and open them without troubles. There is more than 800 subfolders in that folder. Other folders in the cloud drive directory can be searched by Alfred.

I followed the official troubleshooting process, the diagnostic tool shows no problems with a file that cannot be found by Alfred (log attached below).

I tried to rebuild the metadata several times (with full disk access), in the middle of the rebuilding process, Alfred can find some files, shortly after the rebuilding ended, Alfred cannot find those files again.

If you open a file recently, Alfred can find it.

mdfind can find them.

 

Please let me know if anyone has any insight. Thanks!

 

Starting Diagnostics...

File: 'Smith et al. - Unknown - OFFLINE BILINGUAL WORD VECTORS, ORTHOGONAL TRANSFORMATIONS AND THE INVERTED SOFTMAX.pdf'
Path: '/Users/stay/OneDrive/Zotero/storage/SCMMWDJE'

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

Check file cache database...

 File cache integrity is ok

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

Check if file is readable...

 Alfred has permissions to read this file.

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

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

 Indexing is enabled on this drive

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

Check direct file metadata...

 Direct metadata available

Display Name: Smith et al. - Unknown - OFFLINE BILINGUAL WORD VECTORS, ORTHOGONAL TRANSFORMATIONS AND THE INVERTED SOFTMAX.pdf
 Other Names: 
Content Type: com.adobe.pdf
   Last Used: 

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

Check mdls file metadata...

 Metadata contains required items

_kMDItemDisplayNameWithExtensions      = "Smith et al. - Unknown - OFFLINE BILINGUAL WORD VECTORS, ORTHOGONAL TRANSFORMATIONS AND THE INVERTED SOFTMAX.pdf"
kMDItemContentCreationDate             = 2019-09-22 14:57:26 +0000
kMDItemContentCreationDate_Ranking     = 2019-09-22 00:00:00 +0000
kMDItemContentModificationDate         = 2019-09-22 14:57:26 +0000
kMDItemContentModificationDate_Ranking = 2019-09-22 00:00:00 +0000
kMDItemContentType                     = "com.adobe.pdf"
kMDItemContentTypeTree                 = (
    "com.adobe.pdf",
    "public.data",
    "public.item",
    "public.composite-content",
    "public.content"
)
kMDItemCreator                         = "LaTeX with hyperref package"
kMDItemDateAdded                       = 2021-04-15 01:20:11 +0000
kMDItemDateAdded_Ranking               = 2021-04-15 00:00:00 +0000
kMDItemDisplayName                     = "Smith et al. - Unknown - OFFLINE BILINGUAL WORD VECTORS, ORTHOGONAL TRANSFORMATIONS AND THE INVERTED SOFTMAX.pdf"
kMDItemDocumentIdentifier              = 0
kMDItemEncodingApplications            = (
    "pdfTeX-1.40.17"
)
kMDItemFSContentChangeDate             = 2019-09-22 14:57:26 +0000
kMDItemFSCreationDate                  = 2019-09-22 14:57:26 +0000
kMDItemFSCreatorCode                   = ""
kMDItemFSFinderFlags                   = 0
kMDItemFSHasCustomIcon                 = 0
kMDItemFSInvisible                     = 0
kMDItemFSIsExtensionHidden             = 0
kMDItemFSIsStationery                  = 0
kMDItemFSLabel                         = 0
kMDItemFSName                          = "Smith et al. - Unknown - OFFLINE BILINGUAL WORD VECTORS, ORTHOGONAL TRANSFORMATIONS AND THE INVERTED SOFTMAX.pdf"
kMDItemFSNodeCount                     = 530915
kMDItemFSOwnerGroupID                  = 20
kMDItemFSOwnerUserID                   = 501
kMDItemFSSize                          = 530915
kMDItemFSTypeCode                      = ""
kMDItemInterestingDate_Ranking         = 2019-09-22 00:00:00 +0000
kMDItemKind                            = "PDF document"
kMDItemLogicalSize                     = 530915
kMDItemNumberOfPages                   = 10
kMDItemPageHeight                      = 792
kMDItemPageWidth                       = 612
kMDItemPhysicalSize                    = 532480
kMDItemSecurityMethod                  = "None"
kMDItemVersion                         = "1.5"

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

Check file is in search scope...

 File exists within Alfred's default search scope

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

 Troubleshooting passed

 

Edited by Trey
Link to comment

@Trey Could you try popping a brand new simple text file in that folder and see if it is found? (leave it a few mins to index). That will at least see if that folder is being indexed at the moment.

 

Also, are you using Alfred's file search mode (by spacebar prefixing your Alfred query)?

Link to comment
Posted (edited)
9 minutes ago, Andrew said:

@Trey Could you try popping a brand new simple text file in that folder and see if it is found? (leave it a few mins to index). That will at least see if that folder is being indexed at the moment.

 

Also, are you using Alfred's file search mode (by spacebar prefixing your Alfred query)?

Yes, the newly added files (or files that I recently opened) immediately show up in Alfred's search results. In this case, the old unsearchable files in the very folder remain unsearchable.

Yes, I always used the file search mode.

Edited by Trey
Link to comment

@Trey if you create a simple workflow File Filter with the scope of that filter set to this specific folder only, is anything found?

 

Alfred does queries to the macOS metadata, but the top level query can be quite complex to refine the results to your specific configuration. Creating a file filter will create a much more targeted and simple filter over the macOS metadata. Perhaps also try fiddling with the file filter to narrow down file types to see if you can work around what is happening under macOS' hood.

Link to comment
Posted (edited)
32 minutes ago, Andrew said:

@Trey if you create a simple workflow File Filter with the scope of that filter set to this specific folder only, is anything found?

 

Alfred does queries to the macOS metadata, but the top level query can be quite complex to refine the results to your specific configuration. Creating a file filter will create a much more targeted and simple filter over the macOS metadata. Perhaps also try fiddling with the file filter to narrow down file types to see if you can work around what is happening under macOS' hood.

Thanks for the suggestion.

I tried using the default "Dynamic File Search" and "File filter from keyword and reveal" workflows. When the folder is specified the results remain the same - the newly added file can be found but the old files cannot.

There are also cases that a folder cannot be found by Alfred (again, it can be found by Spotlight), but a newly added file in it can be found.

Edited by Trey
Link to comment
  • 2 months later...

@MindSurgeon Have you followed the same steps as the original post? 

 

The first steps to follow when results seem unexpected is to rebuild your Mac's metadata. It's usually because the data being provided by macOS is incorrect or missing (even if it appears correct in the current Spotlight cache), and rebuilding ensures that all this information is refreshed by the OS.

 

Even if you believe you've already reindexed, please follow the steps below specifically (as it involves deleting a cache first and ensuring Terminal has suitable permissions).

  • 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, make your searches again and see if your results are more as expected.

 

If your issue persists, please provide the following information:

  • Your diagnostics file (email to info@), by typing ?diagnostics into Alfred and attaching the resulting file
  • Examples of the File Troubleshooting reports for the files you cannot find using Alfred
  • Details of exactly what you're typing into Alfred and what results you are expecting to see

Cheers,

Vero

Link to comment

Hi, I'd like to confirm that after all the steps in the previous thread. I still wasn't able to fix the search function, and needed to switch to Spotlight. My conclusion previously is that there's an issue with the index (since HoudahSpot also behaves weirdly), but the issue comes from nowhere (I wasn't doing major system updates) and cannot be fixed by rebuilding it.

Link to comment
  • 4 months later...

@stevenrowan Could you please provide more information?

 

  • Which version of Alfred and macOS are you using?
  • Is the issue recent, long-standing, and is it always present or intermittent?
  • Is the issue specific to files in OneDrive or anywhere else too?
  • What is the output of the File Troubleshooting tool if you drag those files in?
  • What are you typing in Alfred (e.g. are you using the spacebar prefix to search all files, or only for apps/folders)?

The more information you provide, the more likely we'll be able to help you out.

 

For files stored normally on your Mac, rebuilding properly (including granting Terminal Full Disk Access, and deleting the Spotlight-V100 file as you begin the rebuild) resolves any indexing issues, but if your issues are specific to OneDrive, something else may be at play.

 

Cheers,
Vero

 

Link to comment

thanks

alfred 4.6 (1266)
Mac OS monterey 12.0.1

for example i have a folder called cardiovascular in my onedrive folder
if i start alfred and type ff (find folder) and type cardiovascular, it does not find this folder

the same occurs with some individual files
alfred can find files and folders contained within the cardiovascular folder and it can find other folders in my onedrive
i have re-indexed the drive as per the instructions above
if i drag the folder into the alfred troubleshooter guide, i get the following message
 

Starting Diagnostics...

File: 'cardiovascular'
Path: '/Users/steven/OneDrive - NHS/CLINICAL/SPECIALITIES - clinical/General Medicine'

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

Check file cache database...

File cache integrity is ok

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

Check if file is readable...

Alfred has permissions to read this file.

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

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

Indexing is enabled on this drive

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

Check direct file metadata...

Direct metadata available

Display Name: cardiovascular
 Other Names: 
Content Type: public.folder
   Last Used: 2021-11-25 17:19:46 +0000

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

Check mdls file metadata...

Metadata contains required items

_kMDItemDisplayNameWithExtensions      = "cardiovascular"
kMDItemContentCreationDate             = 2021-11-22 22:39:36 +0000
kMDItemContentCreationDate_Ranking     = 2021-11-22 00:00:00 +0000
kMDItemContentModificationDate         = 2021-11-23 12:18:28 +0000
kMDItemContentModificationDate_Ranking = 2021-11-23 00:00:00 +0000
kMDItemContentType                     = "public.folder"
kMDItemContentTypeTree                 = (
    "public.folder",
    "public.directory",
    "public.item"
)
kMDItemDateAdded                       = 2021-11-22 22:39:36 +0000
kMDItemDateAdded_Ranking               = 2021-11-22 00:00:00 +0000
kMDItemDisplayName                     = "cardiovascular"
kMDItemDocumentIdentifier              = 0
kMDItemFSContentChangeDate             = 2021-11-23 12:18:28 +0000
kMDItemFSCreationDate                  = 2021-11-22 22:39:36 +0000
kMDItemFSCreatorCode                   = ""
kMDItemFSFinderFlags                   = 0
kMDItemFSHasCustomIcon                 = 0
kMDItemFSInvisible                     = 0
kMDItemFSIsExtensionHidden             = 0
kMDItemFSIsStationery                  = 0
kMDItemFSLabel                         = 0
kMDItemFSName                          = "cardiovascular"
kMDItemFSNodeCount                     = 17
kMDItemFSOwnerGroupID                  = 20
kMDItemFSOwnerUserID                   = 501
kMDItemFSSize                          = 17
kMDItemFSTypeCode                      = ""
kMDItemInterestingDate_Ranking         = 2021-11-25 00:00:00 +0000
kMDItemKind                            = "Folder"
kMDItemLastUsedDate                    = 2021-11-25 17:19:46 +0000
kMDItemLastUsedDate_Ranking            = 2021-11-25 00:00:00 +0000
kMDItemUseCount                        = 1
kMDItemUsedDates                       = (
    "2021-11-25 00:00:00 +0000"
)

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

Check file is in search scope...

File exists within Alfred's default search scope

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

Troubleshooting passed
 

Link to comment

@stevenrowan @KMadvisor Based on the limited information you've provided, I'm guessing you've both migrated your user data from a Time Machine backup or previous Mac to macOS Monterey?

 

If so you'll be experiencing the same issue as the users here, where the underlying index is broken. Please follow the instructions provided here carefully, including granting Terminal Full Disk Access and deleting the Spotlight-V100. 

 

 

This resolves the issue for all users, though some seem to report a delay of a day or two before the index fully resolves itself.

 

Cheers,
Vero

 

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