Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

vaalbara

macrumors member
Original poster
Apr 5, 2022
49
7
Spotlight seems "on": it matches application names and such but no personal documents or files are showing up.
Any ideas?

mdutil -sav shows that indexing is enabled for the mounted volumes (/, Data, external disk..)
 

vaalbara

macrumors member
Original poster
Apr 5, 2022
49
7
Thanks I did that. No change. Also tried adding/removing my user folder "Spotlight Privacy" as Apple had suggested. No change.

I can't see an error on the console either.

After a restart I briefly saw the "indexing progress bar" on the spotlight window and it was working. Now it's dead again.

As a final move I'll try the sudo mdutil -Ea command as suggested here:
 

vaalbara

macrumors member
Original poster
Apr 5, 2022
49
7
This time I added the whole Macintosh HD to "Spotlight Privacy". Surprisingly the system did not let me remove it from the list. The error I got was "Privacy List Error: The item couldn't be added or removed because of an uknown error".

A reboot seems to have fixed it: removed the disk from the privacy list and the indexing started.
 

Honza1

macrumors 6502a
Nov 30, 2013
933
433
US
Years ago I had issue with Spotlight and turned out for some reason there was hidden file .DoNotIndex (or some similar obvious name) in the root folder of my drive, which prevented Spotlight from indexing that drive. Apparently, there are multiple ways of switching off Spotlight on a drive. Check hidden files. May be you have this in the root folder of your Data drive. I had to delete it - and it was protected, so I had to use admin account to change its permissions and delete it. Bit annoying.
No idea how this got there, BTW.
 

bogdanw

macrumors 603
Mar 10, 2009
5,735
2,765
Turn off
Code:
sudo mdutil -ai off
delete index
Code:
sudo mdutil -Ea
turn on
Code:
sudo mdutil -ai on
check status
Code:
mdutil -asv

From the mdutil manual (man mdutil)
"mdutil – manage the metadata stores used by Spotlight
-i on | off Sets the indexing status for the provided volumes to on or off. Note that indexing may be delayed due to low disk space or other conditions.
-a Apply command to all stores on all volumes.
-E This flag will cause each local store for the volumes indicated to be erased. The stores will be rebuilt if appropriate.
-s Display the indexing status of the listed volumes.
-v Print verbose information when available."
 
  • Like
Reactions: vaalbara

vaalbara

macrumors member
Original poster
Apr 5, 2022
49
7
Thanks; yes as a last measure I opted to use the mdutil utility (following the Raycast tutorial I linked earlier). But in a wrong way: I only run the sudo mdutil -i on on the main volume. I should have stopped it first. This gave out an error message as below but somehow restarted indexing later that day:
Code:
/System/Volumes/Data:
Error: unexpected indexing state.  kMDConfigSearchLevelTransitioning

Now I wonder what could have caused this mess? It's either due to trials of HoudahSpot, Raycast or Hyperdock (not supported on Ventura?) that I have installed last week or just a Ventura bug.
 

vaalbara

macrumors member
Original poster
Apr 5, 2022
49
7
I would like to report that right now if the search fails to return a result I'm force quitting mds and mdsstore. The latter generally seems to be consuming %100 CPU at those times. I'll probably end up writing a script that monitors these two processes...
 

vaalbara

macrumors member
Original poster
Apr 5, 2022
49
7
I would like to remind that in order to stop/start Spotlight with the mdutil (as @bogdanw had described above) you need to first "kill" the mds or mds_stores process. Otherwise "sudo mdutil -ai off" command takes minutes or gets stuck...

To be realistic when you are urgently in need of a document...this is not going to help. Re-indexing takes time...Last week I had two important meetings and Spotlight failed to function during both. I'm not sure what to do right now.
 

rhoblidnen

macrumors newbie
Dec 21, 2023
1
0
I had this problem too and I tried all the above things, including the mdutil commands. The only other thing that I could think of was that the .fseventsd contents could have become corrupted somehow, so I deleted that folder on the problem drive (after displaying hidden files with [Cmd]-[Shift]-[.]) and hey presto, I could add it to the spotlight privacy list again with no errors. Of course, this will trigger macOS to re-index the drive which can slow the system down quite a bit, but at least I can search again.
 

joshuafried

macrumors newbie
Mar 4, 2004
29
4
I got the "privacy list" error when trying to add startup drive to the privacy list. But i was then able to drag it into the privacy list from here: /System/Volumes/Macintosh HD. And that is thanks to this thread (tho not spelled out quite that way here...)
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.