0

Don't know how but my Spotlight search stopped working, I search for the solutions but not success:

I tried this command on terminal and got error:

~ % sudo mdutil -i off /
Spotlight server is disabled.
~ %sudo mdutil -i on /
Spotlight server is disabled.

no success

Irfan Anwar
  • 1,878
  • 17
  • 30

3 Answers3

1

Another twist on this for a 27" iMac (Late 2013)... I found my Big Sur 11.6 APFS data volume had somehow gotten disabled (pure speculation: maybe an artefact of using OpenCore Legacy Patcher 0.2.4).

The symptom was that Spotlight searches were returning vanilla operating system hits, so it looked like the root volume was being indexed normally. However no user documents or installed applications were showing up. Because I have a bunch of server volumes mounted I kept checking mdutil status on /, erasing the index, rebuilding the LaunchServicesDB reinstalling macOS and so forth. Nothing worked.

Since I have only one local volume on this Mac I didn't think of looking at the status on any other volume than /. I was tearing my hair out without realising that Spotlight indexes the underlying mount points for a synthetic volume. The smoking gun...

sudo mdutil -sa
/:
    Indexing enabled.
/System/Volumes/Data:
    Indexing disabled.

Since /System/Volumes/Data is only half of a synthetic disk you can't use the Spotlight System Preference pane to deactivate/reactivate indexing. Doing this for the visible Finder volume (ie the synthetic disk) has no effect on /System/Volumes/Data. You can still use mdutil though...

sudo mdutil -i on /System/Volumes/Data
/System/Volumes/Data:
    Indexing enabled.

This worked for me. So simple, but a very untidy artefact of Big Sur APFS. For good measure I also used sudo mdutil -E /System/Volumes/Data to erase the index on the volume but I don't think this was needed. Hope this helps somebody else; this cost me a couple of days of angst.

No idea how my volume got into this state... hopefully I'll never need to figure this out.

ed209
  • 11
  • 1
0

I searched on the internet and found this solution:

Goto Applications -> Utilities
Open Terminal

run this command:
~ % sudo launchctl load -w /System/Library/LaunchDaemons/com.apple.metadata.mds.plist

you will see this output
/:
        Indexing enabled.

Open Spotlight again and search, it should work now.

Irfan Anwar
  • 1,878
  • 17
  • 30
0

I got the same issue after joining mac to AD domain and switching from local mac account to AD mobile profile. Spotlight doesn't show any search results (no emails, files, apps).

Rebuilding emails index didn't help and rebuilding spotlight index didn't help.

I google and came to this article.

It turned out that indexing was disabled for /System/Volumes/Data volume where all files/emails are. Not sure how it happened but thanks to @ed209 I was able to quickly realize the problem and enable indexing. It all works fine now.

sudo mdutil -sa /: Indexing enabled. /System/Volumes/Data: Indexing disabled. <--- this is the problem!

sudo mdutil -i on /System/Volumes/Data /System/Volumes/Data: Indexing enabled.

IlyaP
  • 1