1

I know for a fact that a file named 1A0CFDAF-E43B-49E1-AC88-CD8CC9146947.jpeg exists in my photo library originals/ subdirectory. But searching for 1A0CFDAF-E43B-49E1-AC88-CD8CC9146947.jpeg using Spotlight returns no results.

This is the kind of thing I look for, because if it were obvious I'd already know where it is. I want to have confidence spotlight is searching everything, so that when I get "no result" I know that means "the file does not exist on your hard drive."

Is there a way to expand Spotlight's search domain so that it literally indexes my whole drive and finds any and every file, like it really kind of should?

4
  • Can I just ask how you know for a fact...? Catalina converts your pictures library and replaces the filename with a long UUID alphanumeric string. Your filename does not reflect this. In Catalina the original filename is moved into the file's attributes. Searching for a UUID string (the actual file's name) within my photo library gets a result, as long as "System files are included" in the Spotlight search. – Redarm Jan 4 '20 at 13:08
  • Someone named "ankii" changed the filenames from the right ones to something else. Ask them why they modified my post to be technically incorrect on a technical forum. – Rich Jan 4 '20 at 15:10
  • Editing posts for clarity and additional information is part of how this site works (apple.stackexchange.com/help/editing). Of course any edit should keep the intent of the question intact, that's why the original author gets notified of any edits done and can rollback them if required. – nohillside Jan 4 '20 at 15:27
  • 1
    You can expand the areas Finder searches look in by including Invisible and System files using this method: osxdaily.com/2014/01/30/search-system-files-included-mac-os-x (that shows how to search for System files; Invisible files follows the same procedure, just choose that option). – Calion Nov 20 '20 at 21:58
3

Spotlight doesn't search hidden & system areas at all, by design.

The simplest way to get around this is to use something like EasyFind (freeware) instead. You might need to allow it access to Photos Library, in Privacy and Security preferences.

It doesn't index, so it's slower than Spotlight, but it will find anything, anywhere.

2
  • 1
    Does EasyFind search for the files' attributes? – Redarm Jan 4 '20 at 13:28
  • 1
    Thanks! Good idea. I can also use the "find" command in Terminal to do a slow search of everything each time, but the point of Spotlight is supposed to be that it makes searches fast. I guess you can either have fast or complete but not both... this is a bad design in my opinion. – Rich Jan 4 '20 at 15:14
2

There are two things that may cause this issue.

  1. Some locations / folders are excluded as mentioned by Tetsujin's answer. In addition to that answer, check your System Preferences > Spotlight and see if the file in question is not excluded in the tabs Search Results and Privacy.

  2. In my experience the Spotlight index goes bad relatively often for some reason. Try rebuilding it using one of these methods:

    a. Use an app like Onyx

    b. Follow the method recommended by Apple

    c. Issue the following commands in the terminal (most thorough method, only for experienced users):

    mdutil -i off /
    sudo rm -rf /.Spotlight-V100
    sudo rm -rf /.Spotlight-V200
    mdutil -i on /
    mdutil -E /
    
10
  • 2
    If you go to Photos Library.photoslibrary and right click → Show package contents, you'll find a lot of files which are not indexed by default. Anything that needs "Show package contents", is excluded from Spotlight. – anki Jan 4 '20 at 12:19
  • 1
    @ankii Just to reiterate: searching for a filename in my Photos library does yield a result, as long as "System files are inlcuded" has been selected in the Spotlight search. – Redarm Jan 4 '20 at 13:44
  • @Redarm something changed in Catalina, Mojave here? I cannot find files in say deep in "masters" using spotlight. I have all checkboxes checked in Sys pref. I used Finder's attributes settings to include system files too, no effect. regarding your comment above, I searched for actual file name, let me check UUID. \\ never mind, I cannot see any UUID looking file under photoslibrary package. – anki Jan 4 '20 at 13:51
  • 1
    @ankii "Masters" is deprecated. It's now called "Originals" as in Rich's original post. To be sure I opened an older library with "Masters" folder and found it removed after the Photos conversion. All the original filenames were replaced by UUID filenames and manually searching for one and running xattr -l on the files shows the following attributes: com.apple.assetsd.originalFilename: with the original filename and com.apple.assetsd.publicGlobalUUID: with the UUID actual filename, as attributes. Searching for one of those UUID filenames yields results. – Redarm Jan 4 '20 at 14:07
  • 1
    @Rich use Finder and update search criteria. apple.stackexchange.com/a/108969/313842 – anki Jan 4 '20 at 15:19

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .