MacOS – How exclude a specific folder from spotlight search but not from search window

findermacossearchspotlight

I'm trying to set up my Mac so that it will exclude files in a folder called 'XYZ' from the search results in spotlight only. The reason is because these files are mostly private, and I don't want them to pop up in a spotlight search.

However, I still want to be able to search them in a finder window, where I have a little more control than in spotlight. (To be clear, search normally with alt+command+space, exclude folder from command+space). Any idea how something like this could be done?

Best Answer

From my experience excluding a folder from Spotlight indexing will exclude the files/folders from showing up when you do a search in Spotlight (command+space) but will still allow you to open that folder in finder and use the search bar in the top right of finder to search within that folder only. I imagine that the search of an un-indexed folder means the OSX will search in real time, or temporarily index the folder to allow you to do a folder search that has been excluded from the main Spotlight index and then erase it when you close the Finder window.

Just make sure once you've typed in your search word(s) in the search bar that you click the name of your folder/drive in the "Search" criteria in the grey bar that appears (as shown below).

enter image description here

To exclude a folder from appearing in the Spotlight search, and therefore from being indexed go to: System Preferences > Spotlight > Privacy tab, then click the + and select the folder you want to exclude: enter image description here