0

Since I changed the directory structures of my Mac, Spotlight has not successfully produced search results for my files or folders.

I have tried

  1. Killing SystemUIServer
  2. Rebuilding the Spotlight Index manually using sudo mdutil -E /
  3. Changing Desktop Resolution
  4. Clear caches and preferences using downloaded application
  5. Rebooting Mac

All suggested in this to no effect. 4th item was recommended against on Apple Support Community. And of course, I tried what was suggested by seaturtle.. reindexing Macintosh HD.

Using terminal with the right keywords, the files/folders come up, but I would like to fix permanently.

Has anyone got other idea? Kindly let me know.

  • I currently use Macbook Pro of 2012, OS: High Sierra 10.13.2
3
  • You don't need an external application to clear your caches! Just trash everything in ~/Library/Caches. (I've never had any problems with this, but just to be safe don't empty your trash until you're sure it didn't cause any.)
    – SilverWolf
    Jan 19, 2018 at 16:17
  • can you give explicit commands to 'trash everything in ~/Library/Caches'? I really have trouble understanding compact directions. sorry.
    – dia
    Jan 22, 2018 at 11:51
  • 1
    Sure thing! Just go to Finder, hit ⇧⌘G or Go > Go to Folder..., and type in ~/Library/Caches. This will get you there directly (the Library folder is hidden by default). Then just select everything in that folder and trash it. If something goes horribly wrong, you can just find the stuff in your trash and put it back.
    – SilverWolf
    Jan 22, 2018 at 16:41

2 Answers 2

1

Can you wait for Spotlight to reindex your machine?

If so, try this:

  • Go to the Spotlight section of System Preferences.
  • Go to the Privacy section and add your boot disk (mine is Macintosh HD).
  • Remove it again.
  • Go to Spotlight. Notice the "Indexing..." indicator. You can continue to use Spotlight and the rest of your machine while it indexes, but until it finishes it may not find everything.

Can't wait (or don't want to use Spotlight)?

Try this Terminal command to search by name. Any 's should be replaced with '\'', because otherwise they would end the quoted string.

find ~ -iname '*whatever*'

Searching by file contents is trickier, and will only work for plain text files. Try this:

grep -iRIl 'whatever' ~

What does this all mean?

  • ~ – your home folder
  • -iname – tells find to do a case-insensitive search by filename
  • 'xyz' – single quotes prevent characters like Space, ( or ), etc. from being interpreted by the shell
  • *whatever* – the *s mean "any number of characters can go here". Otherwise, find would only search for files named exactly "whatever".
  • -iRIl:
    • -i – case-insensitive
    • -R – recursive (search subfolders too)
    • -I – ignore files that aren't plain text
    • -l – list files, but don't display matching lines
8
  • I failed on the step 'Go to the Privacy section and add your boot disk (mine is Macintosh HD)'. :( when I drag Macintosh HD icon from sidebar on finder to the the privacy section, the icon just disappears...
    – dia
    Jan 18, 2018 at 13:57
  • Oh, it doesn't look like you can drag folders out of the sidebar onto things. Try hitting ⇧⌘C to view all your connected disks, and then dragging it out of the main part of the window.
    – SilverWolf
    Jan 18, 2018 at 15:33
  • you mean, hit shift + command + c with Security & Privacy window - Privacy tab open? Because it didn't change anything..
    – dia
    Jan 18, 2018 at 18:41
  • Oh, no, sorry, on the Finder window. My bad. (:
    – SilverWolf
    Jan 18, 2018 at 18:42
  • Er, if I press the combination Macintosh HD is selected automatically. If I drag it out from the finder to Privacy tab, it disappears in to void. Sorry I seem to be needing a very much step-by-step explanation for this; but if I drag from the desktop, (which never disappears for reasons I don't know yet) I know I can make a copy to the finder.. but again I can't to Security & Privacy - is it editable? Did it work for you?
    – dia
    Jan 18, 2018 at 18:44
0

Apparently, wasn't reading what the tab controls as the headline shows.. enter image description here

  1. Empty everything under the tab
  2. Drag Macintosh HD and then remove
  3. Wait a little for the Spotlight to reindex
  4. Search should appear alright

Solved!

You must log in to answer this question.

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