How to Rebuild the Spotlight Search Index in macOS to Fix Missing Search Results

The Problem with Corrupted Spotlight Indexes

Spotlight is the primary search engine built into macOS. You invoke it by pressing Command + Space, and it instantly searches your applications, documents, emails, and system settings. To achieve this speed, Spotlight relies on a massive, hidden database known as an index, which constantly tracks the location and contents of every file on your drive.

Occasionally, this index becomes corrupted. When this happens, you may experience highly frustrating symptoms: applications won’t appear when you search for their exact names, document searches return blank results, or your Mac’s fans spin up loudly because the mdworker (metadata worker) process is stuck in an infinite loop trying to read a broken file.

The permanent fix for these issues is to force macOS to delete the existing, corrupted database and rebuild a completely new Spotlight index from scratch.

Method 1: Rebuilding the Index via System Settings (GUI Method)

Apple provides a built-in way to force an index rebuild using the graphical interface. This method tricks macOS into deleting the index by temporarily telling it to ignore your entire hard drive.

For macOS Ventura and Sonoma (macOS 13 & 14)

  1. Click the Apple menu (?) and select System Settings.
  2. In the left sidebar, click Siri & Spotlight.
  3. Scroll down to the bottom of the right panel and click the Spotlight Privacy… button.
  4. A dialog box will appear. Drag the icon for your primary hard drive (usually named Macintosh HD) from your desktop into this list. Alternatively, click the + (plus) button, press Shift + Command + C to view your computer, select Macintosh HD, and click Choose.
  5. macOS will ask for confirmation. Click OK. At this exact moment, macOS deletes the index for that drive.
  6. Select Macintosh HD in the Privacy list, and click the – (minus) button at the bottom to remove it.
  7. Click Done.

For macOS Monterey (macOS 12) and earlier

  1. Click the Apple menu (?) and select System Preferences.
  2. Click on Spotlight.
  3. Click the Privacy tab.
  4. Drag your Macintosh HD into the list, click OK to confirm, then immediately highlight it and click the – (minus) button to remove it.

Method 2: Rebuilding the Index via Terminal (Advanced Method)

If the GUI method fails, or if you are managing a Mac remotely via SSH, you can forcefully rebuild the index using the mdutil (metadata utility) command in Terminal.

  1. Open the Terminal application (found in Applications > Utilities).
  2. To turn off indexing for the main drive and delete the current index, type the following command and press Enter:
    sudo mdutil -i off /
  3. Enter your Mac’s administrator password when prompted.
  4. Now, turn indexing back on by running:
    sudo mdutil -i on /
  5. You should see a message stating “Indexing enabled.”

If you want to forcefully erase the data store before turning it back on, you can use the -E flag:

sudo mdutil -E /

How to Tell if Spotlight is Indexing

Rebuilding the index of a 1TB hard drive can take anywhere from a few minutes to several hours, depending on the speed of your Mac and the number of small files. During this time, Spotlight search results will be incomplete.

To check the status, press Command + Space and type a few letters. If the index is currently rebuilding, you will see a progress bar and the text “Indexing…” at the top of the Spotlight window. Do not restart your Mac until this progress bar disappears.

Conclusion

A corrupted Spotlight index can make a Mac feel broken and unresponsive. By forcefully clearing the privacy cache or utilizing the mdutil command in Terminal, you can prompt macOS to generate a fresh database, instantly restoring the speed and accuracy of your system-wide searches.

Get the best tech tips delivered straight to your inbox.

Join thousands of readers mastering Apple, Google, Microsoft, and Linux.