3

Setup

I've got a MacBook Air (13-inch, 2017)

Problem

When I type in the name of an application, Spotlight doesn't show the application. When I do sudo mdutil -E /, It says the following,

Error: unknown indexing state.

When I Select System Preferences, Click the Spotlight pane, select the Privacy tab and then click the Add (+) button and try to select anything, It says

Privacy List Error, the item couldn’t be added or removed because of an unknown error.

What I tried

I've tried https://www.macrumors.com/how-to/rebuild-spotlight-search-index-on-mac/, and Spotlight re-indexing takes too long or doesn't work. sudo rm -R .Spotlight-V100/ says

No such file or directory

sudo /System/Library/Frameworks/CoreServices.framework/Frameworks/LaunchServices.framework/Support/lsregister -kill -seed -lint -r -f -v -dump -domain local -domain system -domain user -domain network

does a lot of stuff,

sudo rm -R .Spotlight-V100/ also says

Error: unknown indexing state.

How it happened

When I tried to download the macOS Catalina update, the mac got stuck in an endless loop of trying to update and then failing, forcing it into recovery mode, I tried to stop the update by using this link, https://www.mklibrary.com/technology/macos-sierra-stuck-endless-rebooting-loop/ but nothing worked, so I had to fully reinstall macOS, Spotlight now doesn't show any files or applications at all. It only shows other stuff like emails, Dictionary suggestions, etc.

(Note, I've also made sure to check all the categories in system preferences)

I've tried,

sudo mdutil -a -i off,

sudo launchctl unload -w /System/Library/LaunchDaemons/com.apple.metadata.mds.plist

sudo launchctl load -w /System/Library/LaunchDaemons/com.apple.metadata.mds.plist'''

sudo mdutil -a -i on

It worked, however, it stopped working again afterwards when my computer shut down.

  • After re-setting the index, you need to leave it running for 'quite some time' before things can work properly. Also: have you checked that you disk is ok? A failing drive won't index. – benwiggy Sep 2 at 6:01
  • I've waited for a full day, and have used disk utility first aid and nothing seems to be wrong. – Sparky Sep 2 at 6:05
  • @ankiiiiiii Thanks, there's no progress bar at all, – Sparky Sep 2 at 7:32
3

I am not sure whether you have tried this step or not.

Open Terminal window from LaunchPad.

First, turn off Spotlight:

sudo mdutil -a -i off 

Next, unload the metadata file that controls Spotlight’s index:

sudo launchctl unload -w /System/Library/LaunchDaemons/com.apple.metadata.mds.plist 

Use the following command to re-loads the index :

sudo launchctl load -w /System/Library/LaunchDaemons/com.apple.metadata.mds.plist'''

As a last step, turn Spotlight back on:

sudo mdutil -a -i on 

After a few minutes to rebuild the index, Spotlight should be functioning as normal.

Let me know how it goes. Cheers, Udhy

  • Doing sudo launchctl unload -w /System/Library/LaunchDaemons/com.apple.metadata.mds.plist says Could not find specified service – Sparky Sep 3 at 10:07
  • It worked but, it stopped working again @Udhy – Sparky 22 hours ago
  • have you tried this step again ? – Udhy 14 hours ago
  • I have multiple times. It doesn't work anymore @Udhy – Sparky 3 hours ago
-1

Go to system Preferences and click on Spotlight. This brings up a panel where you tell Spotlight where to search. Check that Applications is checked. See figure below.

enter image description here

  • That box has been checked the entire time, – Sparky Sep 3 at 4:10

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .