Hi, this is Gary with MacMost.com. Let me show you how to rebuild your Spotlight Index.
MacMost is brought to you thanks to a great group of more than 1000 supporters. Go to
MacMost.com/patreon. There you can read more about
the Patreon Campaign. Join us and get exclusive content and course discounts.
So when you use a Mac you probably hear the term Spotlight a lot. Actually it refers to several
related things. So when you search for a file sometimes that is called a Spotlight Search. Also,
when you use Command Space or the little magnifying glass in the Menu Bar that's
called a Spotlight Menu. Now when you use either of these you're actually using something called
the Spotlight Index to perform the search. So, for instance, we can use this button here or
just Command Space and it brings up the Spotlight Menu. When you type a term here it is actually
searching many different places including webpages, the Photos App, the Dictionary,
etc. If you want to find files you certainly can sometimes see them here at the top or
if you scroll down you can usually see things like Presentations or Documents.
Now in the Finder you can start at a particular folder and click the Magnifying Glass here or you
can use Command F to start a Spotlight Search and only be searching this directory here depending
upon your settings. You can always switch to searching your entire Mac. But it's only going
to be looking for files, no webpages, photos, or anything else. So, if I search here and press
return you can see I'll get all sorts of documents here, some of which have wombat in the name,
others which don't. Before I complete the search itself I do have the choice to choose just File
Names or Content. So what's actually happening here is not really a search. You would imagine
a search to work by your Mac looking at every single file at that location and seeing if
the name matches the term or if the contents are found inside going from file to file and listing
the results. That would actually take a very long time, even with today's super fast computers and
hard drives. There are just so many files and it takes so long to open and look at each one.
So instead searches are made much faster by using an index. An index is just like an index
in a print book. You wouldn't search through the pages of a book when you want to find something,
reading every word to find it. You would go to the index in the back, look up that word,
and then it would list the page numbers where that word can be found. The Spotlight Index works
the same way. It knows all the file names and the contents in every file and then indexes them. So
when you type a word it can just look up the word in the index and the index would then show which
files contain that word in the name or content of the file. Then it would quickly list them.
When you first get your Mac and set it up it will generate this Spotlight Index
and it will update it as you add and change files. In addition, the Spotlight Index is
completely recreated from scratch, like after a major update. With all sorts of different
apps that we download and add to our Macs and extensions and different ways we search and do
things sometimes the Spotlight Index will break. It will get corrupted in some way
and maybe you won't be able to find the files that you know are there or there
could be other problems like Spotlight gets really slow or returns inconsistent results.
So a Spotlight Search, either with Command Space or by using Command F in the Finder,
isn't working for you quite right you could always try to reindex Spotlight. There's a
really simple way to do this but it's not very intuitive. In macOS Ventura you want
to go to System Settings. You go to System Preferences before Ventura. Then you want to
look for Siri & Spotlight. Before Ventura there's just a section called Spotlight.
But in either case you would look for the Privacy button. You go there you're going to see this
window. You can add locations to prevent Spotlight from searching those locations.
Now you could use this for actual Privacy reasons. For instance,
if there is a folder that for some reason you never want those files to show up in searches
you could hit the Plus button here and select the folder and add it. Typically there is no
reasons to ever do this but occasionally there might be something like a folder filled with
files created by an application and they are always showing up in your Spotlight searches.
You could always add that folder there and those files will no longer bother you when you search.
But you could also use this to reindex Spotlight. So all you would do is open
up this window and then you would go to the top level, your hard drive,
and then you would add this to the Privacy Settings there. Now when I do a search
you're going to see nothing comes up because the index doesn't have anything from my local
hard drive. So it is certainly not going to find anything in the Documents folder.
So to reindex all you need to do is once you've added it, select it again, and then remove it.
Now it will add it back. Now this is going to take some time. Here you can see if I do
a search only a fraction of what I had before. Just the files names for now.
If I do Command Space I can actually see right up here. It shows Indexing,
and there's a progress bar. At the beginning the Progress Bar will do this, going back and forth,
showing it is preparing. Then you may see it for a time with blue filling the entire bar.
But eventually you'll see it gradually fill up the bar until it's complete. Until then
you'll still find things outside of Spotlight. It will be a limited set of results and documents.
It won't be until this is complete that you can be sure that you will get all the results.
Now you may think this is a really strange way to do something on your Mac. Shouldn't there
be a button there in System Settings or maybe a menu item in the Finder or something. Well,
this is the way to do it! In fact Apple even has this support page right here and on this support
page they show exactly this method for adding to the Privacy List and then removing it again.
Now there are some things that you can do with Spotlight indexing in the Terminal.
You could use mdutil and if you just use sa the s is going to list the status and a for
all volumes. You could see her that indexing is enabled for everything. If we had checked
that while the Mac hard drive was added to the Privacy List you would see it disabled for the
main volume. Now you can use this command, mdutil-Ea, and that will attempt to rebuild
all of the different Spotlight indexes on all of the attached volumes. You need to
put pseudo in front of it because they need it to give it permission to run. It's going
to prompt you for your password. But in almost all cases you shouldn't need to
use this. Using the System Settings method is all that you should need to reindex Spotlight.
Now a word about when to use this. First of all I would only rebuild your Spotlight Index if you
really believe there's a problem with Spotlight. Don't do it just to see maybe if it speeds things
up a little bit or something like that. There should be a clear problem, like files that are
definitely there and they are definitely not showing up when you do a search. Secondly,
it's going to take a while to rebuild this file by index. The ideal time to do this is at the
end of day when you're not going to be using your Mac for awhile. Of course you should let
your Mac sleep overnight. Don't shut it down. That is something you should be doing anyway,
every night. Of course if you're using a MacBook it should be plugged into power
because it is going to be busy working on this and that will drain the battery.
So I hope you learned something about Spotlight Index. Thanks for watching.