Spotlight indexing somehow disabled--how to re-enable?

I noticed that spotlight no longer "sees" Application files when I search. To remedy, I added and removed the Applications folder from the Spotlight Privacy pane. When that didn't work, I added and removed the entire hard drive with the same result.


The next steps were sudo mdutil -E / and then sudo mdutil -sa. I got the victory message after sudo mdutil -sa, but spotlight still ignores apps.


Next step?

Mac mini

Posted on Jul 1, 2023 9:50 PM

Reply
Question marked as Best reply

Posted on Jul 19, 2023 9:07 AM

For those who are still struggling with this, here's the fix. You have to execute all four commands in this order (thanks to the unnamed person who posted this way back in 2011):


sudo mdutil -i off /
sudo rm -rf /.Spotlight*
sudo mdutil -i on /
sudo mdutil -E /

In order, these accomplish:

  1. turn indexing off
  2. delete Spotlight folder
  3. turn indexing on
  4. rebuild



19 replies
Question marked as Best reply

Jul 19, 2023 9:07 AM in response to Eric Espino

For those who are still struggling with this, here's the fix. You have to execute all four commands in this order (thanks to the unnamed person who posted this way back in 2011):


sudo mdutil -i off /
sudo rm -rf /.Spotlight*
sudo mdutil -i on /
sudo mdutil -E /

In order, these accomplish:

  1. turn indexing off
  2. delete Spotlight folder
  3. turn indexing on
  4. rebuild



Apr 22, 2024 2:24 PM in response to Eric Espino

Spotlight is a core technology in macOS and extremely complicated. There can be multiple possible causes for what appears to be the same problem.


I recently had an episode where I experienced the problem. In my case, had to rebuilt my computer and had copied many apps back to the computer from backup. Those apps were not indexed in Spotlight until I had launched them at least once.


So, if anyone is experiencing this problem in the future, try to manually launch the app that should be appearing in Spotlight results. See if Spotlight then behaves correctly for this one app. If so, maybe you just need to re-launch all apps to get them back into the system.

Jul 19, 2023 9:07 AM in response to Eric Espino

For those who are still struggling with this, here's the fix. You have to execute all four commands in this order (thanks to the unnamed person who posted this way back in 2011):


sudo mdutil -i off /
sudo rm -rf /.Spotlight*
sudo mdutil -i on /
sudo mdutil -E /

In order, these accomplish:

  1. turn indexing off
  2. delete Spotlight folder
  3. turn indexing on
  4. rebuild




Jul 19, 2023 9:19 AM in response to Eric Espino

you can follow these steps to re-enable it:

  1. Open "System Preferences": Click on the Apple logo in the top-left corner of your screen and choose "System Preferences" from the dropdown menu.
  2. Navigate to "Spotlight": In the System Preferences window, click on the "Spotlight" icon. It is usually located in the top row or search for "Spotlight" using the search bar in the top-right corner of the window.
  3. Check the "Spotlight" settings: In the Spotlight preferences, ensure that the "Search Results" tab is selected at the top.
  4. Enable indexing for desired locations: In the "Search Results" tab, you'll see a list of categories on the left, like Applications, Documents, etc. Make sure the checkboxes next to the categories you want Spotlight to index are checked.


Jul 2, 2023 5:04 PM in response to Eric Espino

You didn't try to install Sonoma or anything did you?


I recently experienced this exact problem on my brand new computer, which I purchased, in part, to run Sonoma. So there were no 3rd party complications. Nothing but Apple software. What I had done was install both Ventura and Sonoma and I enabled FileVault on both the Sonoma and Ventura volumes. Maybe that caused it. Maybe it was just Sonoma. I don't know.


The only fix was erasing the hard drive and reinstalling Ventura. I actually had to do a DFU restore. Fun! But that fixed it.

Jul 19, 2023 11:36 AM in response to Eric Espino

Eric Espino wrote:

For those who are still struggling with this, here's the fix. You have to execute all four commands in this order (thanks to the unnamed person who posted this way back in 2011):

sudo mdutil -i off /
sudo rm -rf /.Spotlight*
sudo mdutil -i on /
sudo mdutil -E /
1. In order, these accomplish:
turn indexing off
2. delete Spotlight folder
3. turn indexing on
4. rebuild

You only need 2. The rest will happen automatically.

It also may fix a problem where results don’t populate for selected folder but do for This Mac.

May 14, 2024 5:29 PM in response to Eric Espino

In my case (MacOS 14.4 Sonoma, MacBook Air M2), the Spotlight index file was at ~/.Spotlight-V100, not at /.Spotlight*. The key is the ~ tilde, a shortcut for /Users/<username>.


You can try these:


Show all 'hidden' files in your home directory. You'll probably see '.Spotlight-v100'.

ls -Fd ~/.*

Show all 'hidden' files in the root directory.

ls -Fd /.*

Show just the Spotlight file in your home directory.

ls -Fd ./Spotlight-v100


Get the size of the Spotlight index.

du -hcd 1 ~/.Spotlight-v100


I opened Activity Monitor before I started the rebuild so I could see the… Well, the activity. Click CPU and in the search box enter 'mdworker'.


So, the full rebuild recipe for me was this:

sudo mdutil -i off /
sudo rm -rf ~/.Spotlight-v100
sudo mdutil -i on /
sudo mdutil -E /


The %CPU for mdworker didn't shift much, but already some things I couldn't find before are appearing.





Spotlight indexing somehow disabled--how to re-enable?

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple ID.