tl;dr (10 January 2022): Spotlight can no longer find any files except applications. It's been using a lot of %CPU for days to reindex but has not made any progress.
tl;dr (2 March 2022): To my horror, the problem persists after wiping my disk and reinstalling macOS from scratch. This time, Spotlight is not using much %CPU.
10 January 2022
See "2 March 2022" section below for more up-to-date info
I use a MacBook Pro Retina (13-inch, Mid 2014) running macOS Big Sur 11.6.2. [2 March 2022 update: macOS 11.6.4] 256 GB SSD, 8GB RAM. 2 cores @ 2.8GHz.
Spotlight has stopped being able to find any files except applications. Spotlight is just indexing forever. My battery drains much faster from all the reindexing (mdsync typically uses between 20% and 80% of my CPU according to Activity Monitor). [2 March 2022 update: mdsync no longer appears to be working at all] I have left the indexing run for 48 hours and there was no progress whatsoever. It still couldn't find files sitting on the desktop.
Here's what I've tried, among many others:
- Rebuilding the spotlight index using Apple's official method (https://support.apple.com/en-us/HT201716). This involves adding the home folder to the Privacy exclusion list in System Preferences → Privacy.
- Rebuilding Spotlight with the terminal (method 1 here https://www.makeuseof.com/tag/cant-find-mac-apps-spotlight-fix/).
- The method described in this question (Spotlight re-indexing takes too long or doesn't work), which kills the Launch Services Database.
sudo rm -R .Spotlight-V100/(returnsrm: .Spotlight-V100/: No such file or directory).sudo mdutil -E /andsudo mdutil -s /(returnsIndexing enabledwith no improvement).
Apart from the above, most command line solutions I have tried returns some kind of error, regardless of whether I use sudo or not.
How can I get Spotlight working again?
2 March 2022
tl;dr: The problem persists after wiping my disk and reinstalling macOS from scratch!
A few days (at some point between 15 and 30 January) after the above post (10 January), Spotlight randomly started working again. Perhaps it started working when I updated from macOS 11.6.2 to 11.6.3 although I cannot confirm this. It then worked fine until 24 February when I updated from 11.6.3 to 11.6.4. At this point, the problem described above resurfaced in the exact same form: One morning Spotlight could find any file on my system. Then a few hours later it could not find anything except applications.
After spending hours and hours in vain trying to solve the problem, I decided to reinstall macOS. To solve the problem once and for all, I did a "clean" reinstall: I put my important files on an external drive, I wiped my Macbook's SSD, and I reinstalled macOS 11.6.4 on the empty SSD.
I then added back about 70 GB of important files that I had backed-up. About 30GB of these are PDF files with textual data. I absolutely need these 30GB of data indexed by Spotlight in order to be able to work. But now, two days after the reinstall, Spotlight can't find any PDF file (except sometimes for "ENERGY STAR.pdf", which is a file that it could also find back in January when the problem first arose):
I have not run any terminal commands since I reinstalled macOS except for a few to try to view the status of the indexing. I have not run any commands that could have modified or damaged the index or the indexing process.
I don't know of any way of knowing whether Spotlight is actually indexing or just pretending to index without making any actual progress. From the activity monitor, it looks like Spotlight's "mdworkers" are doing very little work (but not zero):
Something that may be related is that in Console.app → system.log, I get thousands of messages like this:
Mar 2 12:42:06 MacBook-Pro com.apple.xpc.launchd[1] (com.apple.mdworker.shared.01000000-0000-0000-0000-000000000000[45791]): Service exited due to SIGKILL | sent by mds[45785]
Mar 2 12:42:14 MacBook-Pro com.apple.xpc.launchd[1] (com.apple.mdworker.shared.03000000-0000-0000-0000-000000000000[45792]): Service exited due to SIGKILL | sent by mds[45785]
Mar 2 12:42:14 MacBook-Pro com.apple.xpc.launchd[1] (com.apple.mdworker.shared.01000000-0100-0000-0000-000000000000[45804]): Service exited due to SIGKILL | sent by mds[45785]
Mar 2 12:42:14 MacBook-Pro com.apple.xpc.launchd[1] (com.apple.mdworker.shared.06000000-0000-0000-0000-000000000000[45797]): Service exited due to SIGKILL | sent by mds[45785]
A strange observation
2 March 2022
I've actually found a way to get Spotlight to work very briefly on particular folders, see screenshots below.
How can I get Spotlight working again? This is driving me nuts!
Added 4 March 2022
Here is the output of mdimport -L as requested by @Gilby:
user@MacBook-Pro ~ % mdimport -L
Paths: id(501) ( "/System/Library/Spotlight/SystemPrefs.mdimporter", "/System/Library/Spotlight/Chat.mdimporter", "/System/Library/Spotlight/iWork.mdimporter", "/System/Library/Spotlight/iPhoto.mdimporter", "/System/Library/Spotlight/PDF.mdimporter", "/System/Library/Spotlight/RichText.mdimporter", "/System/Library/Spotlight/Office.mdimporter", "/System/Library/Spotlight/PS.mdimporter", "/System/Library/Spotlight/MIDI.mdimporter", "/System/Library/Spotlight/Archives.mdimporter", "/System/Library/Spotlight/Audio.mdimporter", "/System/Library/Spotlight/iPhoto8.mdimporter", "/System/Library/Spotlight/Automator.mdimporter", "/System/Library/Spotlight/Application.mdimporter", "/System/Library/Spotlight/Font.mdimporter", "/System/Library/Spotlight/Mail.mdimporter", "/System/Library/Spotlight/QuartzComposer.mdimporter", "/System/Library/Spotlight/vCard.mdimporter", "/System/Library/Spotlight/Image.mdimporter", "/System/Library/Spotlight/iCal.mdimporter", "/System/Library/Spotlight/CoreMedia.mdimporter", "/Library/Spotlight/iBooksAuthor.mdimporter" )






mdimport -Lwhich lists all spotlight importers.mdimport -Lon my Mac shows about 20 3rd party importers. – Gilby Mar 04 '22 at 22:37