Broken Finder

Discussion in 'macOS Sierra (10.12)' started by dlbmacfan, Aug 13, 2017.

  1. dlbmacfan macrumors regular

    Joined:
    Jul 20, 2011
    #1
    I've discovered a strange problem with Finder. It only returns partial search results, as you can see in the attached screenshot. I've spoken at length (5-10 total conversations over a period of weeks) with upper level Apple Support but they were unable to find a solution. The problem is not specific to one computer. When I sent a group of images to Apple Support, Finder on their computer missed the same files that were missed on my computer. I get matching erroneous search results on all of my Apple computers. The problem is not specific to a single text string or a specific folder. Any help here would be greatly appreciated!

    [​IMG]
     
  2. Fishrrman macrumors G5

    Fishrrman

    Joined:
    Feb 20, 2009
    #2
  3. dlbmacfan, Aug 13, 2017
    Last edited: Aug 13, 2017

    dlbmacfan thread starter macrumors regular

    Joined:
    Jul 20, 2011
    #3
    Thanks for the links. I'll definitely have a look. But I'm also interested in understanding why Spotlight Search fails at this basic task, and finding a solution from inside OS X.
    --- Post Merged, Aug 13, 2017 ---
    If any of you is interested in testing my problem on your own computer, try naming a JPEG "20170806-_Z2A9657-Pinyon-Jay-4x6.jpg" leaving out the quotation marks. See if spotlight search can locate it. Another curious behavior: if you delete "-4x6" from the title, spotlight search is able to locate the file.
    --- Post Merged, Aug 13, 2017 ---
    Find Any File works great! So why does Spotlight Search come up short?
    --- Post Merged, Aug 13, 2017 ---
    Here's what Find Any File locates:

    [​IMG]
     
  4. MacGizmo macrumors 65816

    MacGizmo

    Joined:
    Apr 27, 2003
    Location:
    Arizona
    #4
    Spotlight found the file instantly on my Mac. I'm running 10.12.6. (see below):

    [​IMG]
     
  5. dlbmacfan thread starter macrumors regular

    Joined:
    Jul 20, 2011
    #5
    Try searching for the word Pinyon instead. I'm a bird photographer and I use Finder to locate all photos of a given species. But it only returns partial results.
     
  6. ab298 macrumors member

    Joined:
    Jun 18, 2017
    #6


    I see the same problem that you do : it's been raised before at
    https://apple.stackexchange.com/questions/175294/how-finder-can-find-this-file-with-long-name
     
  7. dlbmacfan thread starter macrumors regular

    Joined:
    Jul 20, 2011
    #7
  8. ab298 macrumors member

    Joined:
    Jun 18, 2017
    #8
  9. MC6800 macrumors 6502

    Joined:
    Jun 29, 2016
    #9
    I played around with this and there's something really weird going on with Spotlight's string interpretation there, related to the "-4x6" on the end of the name, of all things. Apparently any name ending in the form number-letter-number causes it to not match.

    There is a workaround, but it's not pretty:

    In Finder, do a Command-F to bring up a search window.
    Click the "kind" pulldown and choose "Other...".
    Type "Raw" in the search box there, and set the "In Menu" checkmark for Raw Query. Click OK.
    Click the "kind" pulldown again and choose "Raw Query".
    In the new Raw Query box, enter exactly:
    Code:
    kMDItemFSName = '*Pinyon*'
    Click "Save" to make this a Smart Search if you like.

    This can also be done from the command line:

    Code:
    mdfind "kMDItemFSName = '*Pinyon*'"
    It would be nice if there were a way for mdfind to show its interpretation result. Anyone know how?
     
  10. ab298 macrumors member

    Joined:
    Jun 18, 2017
    #10
    It seems to work here by choosing Name : contains in a smart folder.

    Not perfect, but having that in the sidebar & clicking to type a different search term is perhaps easier than using another application. Screen Shot 2017-08-13 at 15.50.48.png
     
  11. MC6800 macrumors 6502

    Joined:
    Jun 29, 2016
    #11
    Good find-- I hadn't expected that to work because it still interprets, but see that it interprets differently, using the save-search feature and examining the XML file that saves in ~/Library/Saved\ Searches for the RawQuery field.

    Bad case (original) is equivalent to:

    mdfind '(kMDItemDisplayName = "pinyon*"cdw)'

    Good case (yours):

    mdfind '(kMDItemDisplayName = "*pinyon*"cd)'

    I tried other combinations and it seems it's the "w" comparison modifier that causes the strange failure. The "c" and "d" are documented here, but not "w"?
    --- Post Merged, Aug 13, 2017 ---
    Found the updated documentation, and the "w" modifier causes a word-based comparison. Definitely has a bug in it.
     
  12. dlbmacfan, Aug 13, 2017
    Last edited: Aug 13, 2017

    dlbmacfan thread starter macrumors regular

    Joined:
    Jul 20, 2011
    #12
    That actually seems to work! Thank you very much for your input!

    [​IMG]
     
  13. Ebenezum macrumors 6502a

    Joined:
    Mar 31, 2015
    #13
    I noticed similar problem back when Yosemite was released and reported it to Apple. I also reported it for the all newer versions.

    Unfortunately it hasn't been fixed but if enough people report it Apple might fix it. Although I have given up on Spotlight and I currently use EasyFind which works much better.
     
  14. BLUEDOG314 macrumors 6502

    BLUEDOG314

    Joined:
    Dec 12, 2015
    #14
    I have experienced similar things before. You could try to force macOS to reindex your drive and see if that helps. Go into system preferences > spotlight > privacy, then add your entire Macintosh HD volume to the exceptions list. Close system preferences, then go back and remove it from the exceptions list and give it time to reindex.

    If this fails you can always use the less elegant find in terminal.
     
  15. dlbmacfan thread starter macrumors regular

    Joined:
    Jul 20, 2011
    #15
    Reindexing was the first thing I tried. It doesn't work. But several of the suggestions above do work, and they're not too clunky.
     

Share This Page