Fixing Broken File Search On Your Mac

If you searching your Mac for a file doesn't return the results you expect, then there are several common culprits. You may simply not notice that the scope of the search is limited to the current folder instead of your entire drive. Or, you may have your Spotlight settings set to not look for some files. If there is a more serious problem, you can try re-indexing your Mac to fix broken search results.
Video Transcript / Captions
Closed captioning for this video is available on YouTube: Fixing Broken File Search On Your Mac.

So let's say I want to perform just a regular search for files on my Mac. Before I do I want to show you that I've got this file here called List of Meteor Showers. It's a PDF. So great. You know that it's there. Now I'm in a different Finder window at a different time and I want to search for it. I'm going to type in meteor. I'm even going to select File Name Matches and you can see nothing shows up. What's going on here? Why can't I find this file? It should be real easy for your Mac to find this file but it doesn't show it.

Well, there's several different things that can be wrong. The main thing is, and what is wrong here, and some of you may have already spotted it, is at the top here it says Search and I can choose This Mac or Projects. Now before I did the search I was looking in a folder called Projects. So when I started the search it started looking in the folder called Projects. Turns out that file isn't in there. It's in another folder. So it didn't find it. Now I can easily solve this problem by switching from Projects to This Mac and now, sure enough, it finds this List of Meteor Showers. It finds a few other files with the word meteor in them as well. So my main problem there was the scope. I had Projects selected instead of This Mac.

How can you prevent this? Well, if you always want to start your searches off searching your entire Mac you can set a preference for that. You can go to Finder Preferences and you go to Advanced there is an option here, When Performing a Search, and you can say I want it to always search the current folder, I want to always just search This Mac which will get you what you want, and also you can say Use the previous search scope. So wherever your last search was it will search there. So you can set this up for Search This Mac and now it doesn't matter if I'm in this Projects file and I search for meteor it will find that file even though I've started out the search in the Projects folder. This Mac is selected rather than Projects, the name of the folder.

But what if that's not the problem. What if you're sure you're search This Mac and you're still not finding a file you know is there. Well, the next thing to do is look at your Spotlight preferences. So go to System Preferences and go to Spotlight. Spotlight is the system you're using to search your Mac. Then check your search results preferences here and make sure that Folders, and make sure that whatever file type it is you're looking for like PDF documents or Documents, or whatever it is, is selected. If it's not selected it may not be indexing that type of file. So go through this carefully. For most of us you're going to have everything here checked. Sometimes you uncheck things like I don't want it to look in the Developer tools for things. I prefer to search mail inside the Mail app and not have those come up inside of Spotlight. But go and make sure that maybe you haven't turned off too many of these to make searches work.

Also look in Privacy. Privacy is where you may have added a folder that you don't want search results to appear. For instance, say if you've got a directory of work files and they've got thousands of files and they've got all sorts of different names and they're always showing up in your searches. But for some old project you're not using anymore you can use the plus button, add that folder, and then anything in that folder won't show up when you do a search. But sometimes people add things by accident in here. Maybe you added something for a temporary purpose and you forgot. So check in there to make sure that that isn't a problem.

Now, what happens if you have all that and you're sure it's all right. You're sure that there's something wrong with the search function on your Mac. Well, there's something called a Search Index or a Spotlight Index on your Mac that's an index of all your files. When you do a search your Mac isn't actually looking at every file and comparing the results. That would take too long. Instead what it does is it builds this quick index, like the index at the back of a book. When you're searching for something in a book you don't start looking at every word on every page for it. You go to the index and you look at it alphabetically.

Well, Spotlight has an index like that. If for some reason that index is messed up you can force it to rebuild. The way to do that is you go in here, Privacy, and you add the entire, say, your Documents folder. Or better yet even your entire Home folder in this case. My Home folder is called MacMost. You add it and then you simply remove it. Adding it removes all those results from the index and then adding it back again means it will reindex that. Now it doesn't happen instantly. It takes some time. So it's not the kind of thing where you can do it and then expect the searches, a few seconds later, to have those entries in there. It may take several minutes or hours. Maybe even overnight if you have a massive hard drive filled with data files for it to do the index. But that is the official way that Apple wants you to rebuild your Spotlight index if you're having trouble.

Apple has an official page of what to do if Search isn't working on your Mac. They basically run through the things I just showed you. Another thing it shows you right at the top is to make sure the text in the search field is what you want it to be. It could be very easy to have a little typo in there and then drive yourself crazy for the longest time trying to figure out why Search isn't working when maybe you're just one character off. Of course they list that first because I'm sure the percentage of error is greater than zero percent. So you might want to just double check that or just when in doubt just retype the search term from scratch.

Comments: 10 Responses to “Fixing Broken File Search On Your Mac”

    1 year ago

    The adding and removing instructions went over my head (around 5.01). Where do you remove it from? And how do you add it again? Copy/paste? Thx, Gary

    1 year ago

    Dee: At 5:01 I’m showing the Privacy part of the Spotlight preferences. At the bottom are + and – buttons. Use the + button to add your Home folder, then select it and use the – button to remove it. You add first (to exclude from the search) and then remove second (to re-include in the search).

    Marcia Byerly
    1 year ago

    Thanks Gary! You just solved one of my pet peeves about having to constantly make my search iCloud instead of something else. There are so many things in Macs that I didn’t know were there or how to use them. Your tutorials are wonderful!

    1 year ago

    Awesome! Thank you! Again, you solved a problem area for me!

    Phil Rodokanakis
    1 year ago

    I believe that the Terminal command to rebuild the index is a lot easier than adding and removing a drive to the Spotlight’s privacy preferences.
    sudo mdutil -i on /

    1 year ago

    Phil: It is easier, but it has a few things against it. Not everyone is comfortable using Terminal commands, let alone sudo in the Terminal. Also, Apple’s “official” method is the one I show, which they also show on that web page.

    1 year ago

    hi Gary
    I just installed MS Excel on the Mac a couple of days ago and it’s still not showing up in my Spotlight search. I was going to try the add and remove method in the Privacy settings but the shortcut to the Excel app is greyed out and not selectable in that screen. Any suggestions? thx

    1 year ago

    Nick: Searching for Applications is probably different than searching for files and this technique is for files. I would try turning off “Applications” in the Spotlight preferences, and then turning it back on again. Also, maybe a restart.

    Scott Simmerman
    1 year ago

    That finder search window that shows “This Mac” and “This Folder” has space for OTHER folders to be added. I have a couple of folders (Posters and Images to Sort) that I OFTEN and ONLY want to search because I am looking for something specific.

    Is there a way to add these “common default folders” to that Searching window?

    1 year ago

    Scott: No, thats not a customizable toolbar or anything like that. Instead, put those folders in the left sidebar of the Finder window, click on them first, before clicking the Search field and typing. It would be the same number of actions (click, click, type instead of click, type, click).

Comments Closed.