Spotlight broken after sleep

Most of the time after my iMac sleeps and wakes spotlight does not work properly. It will find applications and system files but not anything in my user directory. I have tried the instructions in this support document and they don't fix it. The terminal commands described here work temporarily (until the next sleep) but the output in my terminal does not match what that site shows in their instructions and shows several errors. (I have also deleted the spotlight preferences file and that only helps until the next sleep). I am hoping the errors in the terminal output below will help diagnose the issue.


My terminal looks like this:

username:~ username$ sudo -i

Password:

username:~ root# mdutil -Ea

/:

Indexing enabled.

/System/Volumes/Data:

Indexing enabled.

/System/Volumes/Preboot:

Error: unknown indexing state.

username:~ root# mdutil -ai off

/:

2023-02-27 10:21:37.626 mdutil[6944:110848] mdutil disabling Spotlight: / -> kMDConfigSearchLevelFSSearchOnly

Indexing disabled.

/System/Volumes/Data:

2023-02-27 10:21:38.717 mdutil[6944:110848] Volume /System/Volumes/Data is transitioning, waiting 5 seconds (try 1 of 15)

2023-02-27 10:21:43.723 mdutil[6944:110848] mdutil disabling Spotlight: /System/Volumes/Data -> kMDConfigSearchLevelFSSearchOnly

Indexing disabled.

/System/Volumes/Preboot:

Error: invalid operation.

Error: unknown indexing state.

username:~ root# mdutil -ai on

/:

Indexing enabled.

/System/Volumes/Data:

Indexing enabled.

/System/Volumes/Preboot:

Error: invalid operation.

Error: unknown indexing state.

username:~ root#


I had this problem under Monterrey (when I got the computer) and upgrading to Ventura did not solve it.

iMac

Posted on Feb 27, 2023 7:31 AM

Reply

Similar questions

3 replies

Feb 27, 2023 1:46 PM in response to curtisdozier

curtisdozier wrote:

Most of the time after my iMac sleeps and wakes spotlight does not work properly.


I had this problem under Monterrey (when I got the computer) and upgrading to Ventura did not solve it.


Granted an odd situation ie sleeps/wakes...


I would exit out of root.


the same thing can be accomplished easily enough, rebuilding the database:

sudo mdutil -E /


But what I will say— it seems to me you get a better results using the HD drag & drop method for re-indexing

this seems to sort many anomalies in re-indexing....maybe yours




Rebuild the Spotlight index on your Mac - Apple Support


This thread has been closed by the system or the community team. You may vote for any posts you find helpful, or search the Community for additional answers.

Spotlight broken after sleep

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