spotlight indexing not working

I'm running Mojave on a MBP early 2015.


Spotlight has stopped working on my internal drive and 3 USB drives.


I've tried using the Spotlight Privacy tab tricks in System Preferences and, when that didn't work, the terminal 'sudo mdutils -E' approach.


The Terminal response is


    Error: unknown indexing state


Not sure what to do. I've searched for how to rebuild index from scratch or any other approach to restore to a known state and then proceed from there.


Any other ideas of what to try?

Posted on Feb 12, 2022 12:08 PM

Reply

Similar questions

22 replies

Apr 17, 2022 11:32 AM in response to zaj-carlosman

I have now worked on this problem for 4 days and today fixt it. same problem thugh i have not done this in safe mode stil worked for me.... if you have problem with erasing old .spotlight-V100 folder (Trinkertool, if you dont se hiden files/folders) or if it dosent help try with Onyx.app ( search on google and instal correct version for you machine.)

maintenance: both. Rebuild; Launchservices, dyld´s, XPC, CoreDuet, Spotlight and volyme on desktop -> auto restart when finish.

if 'sudo mdutil -sa' is ok but not 'sudo mdutil -sa /Applications' or that you cant add without error 'sudo mdutil -E /Applications' then try BDAqua text after.


wait until each step is complete and your user name 'Macintosh-2:~ Name$' before writing the next comand, if the first does not go through procced with the second.


/System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/LaunchServices.framework/Versions/A/Support/lsregister -kill -r -domain local -domain system -domain user


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


killall Dock


sudo mdutil -E /


sudo mdutil -i on /


P.S remove NTFS for mac if you have that installed. disable wont help.


MacBookPro 6,1 17'' (2010) with SSD

Feb 12, 2022 1:29 PM in response to zaj-carlosman

Safe Boot, (holding Shift key down at startup), does the problem occur in Safe Mode? Could take 10 minutes.


Safe mode attempts to repair Disks & clears lots of caches & loads safe Drivers, & prevents loading of 3rd party extensions, so if Safe Mode works try again in regular boot.


Manually Rebuilding Spotlight via Terminal

If the aforementioned Spotlight control panel approach doesn’t spur a reindexation of the drive, you may need to initiate it manually through the command line. Open Terminal and use the following command string to do so:


sudo mdutil -E /

This basically asks for temporary super user status, which is why Terminal may ask you for your password (it may not if you’ve used a sudo command recently or are already logged in as a super user or root. The command asks the unix tool mdutil to reindex the spotlight database for everything on the computer, including external drives, mounted disk images, etc. To re-index only for a specific drive, use the /Volumes path. For example, for an external drive named “MiniMe,” the command would look like this:


sudo mdutil -i on /


Rebuilding a drive index can take a long time, so be prepared to wait whether you do it through the System Preference panel or the command line.


If still need be…


Open Terminal and run each of these one at a time


/System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/LaunchServices.framework/Versions/A/Support/lsregister -kill -r -domain local -domain system -domain user


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


killall Dock


sudo mdutil -E /


sudo mdutil -i on /


Rebuilding a drive index can take a long time, so be prepared to wait whether you do it through the System Preference panel or the command line.

May 20, 2022 11:05 AM in response to doncagen

after a manual removal of the spotlight Index ( private/var/db/Spotlight-V100/Volumes/ ) and a reboot of computer do you get more mds activity? If yes and still doesn’t work it’s a other system file that’s the problem if you some time have installed a pirate app most time manually or automatic a new text line is saved in the…. Select Go ➙ Go to Folder… from the Mac menu bar

Type in /private/etc/hosts


check google for what should be there. Then reboot. And do a remap of index first with the app onyx then commando etc etc.


make sure you have apfs formatted disk first in disk utility if not search for how to convert.

Mar 2, 2022 1:27 PM in response to BDAqua

Thanks for your helpful reply. Unfortunately, the first 2 suggestions don't work...


1 - Safe Mode boot - the problem here is that in Safe Mode the system does not see the external flash drive, so no re-indexing is attempted


2 - Terminal mdutil command - this fails as I described in my original post with the "Error: unknown indexing state" message


Is there anything I may be missing re either of the 2 approaches above?


I have questions about the third suggestion... with the 2 commands to be entered:


/System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/LaunchServices.framework/Versions/A/Support/lsregister -kill -r -domain local -domain system -domain user

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

are the arguments ("local", "system", "user", "network") to be entered verbatim or do I substitute my specific values (e.g. my username)?


Thanks again for your help

Mar 2, 2022 4:31 PM in response to zaj-carlosman

adding to my last post, I tried entering the Terminal commands and after the second one:


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


I got a bunch of errors (see below) and then a long spew of repeating messages (not copied here):


lsregister: registered library com.apple.system-library
lsregister: registered library com.apple.local-library
lsregister: error -43 registering library com.apple.network-library
lsregister: error -43 registering library com.apple.user-library
lsregister: error -43 registering library com.apple.apple-internal-library
lsregister: registered plugin /System/Library/Frameworks/Quartz.framework/Frameworks/QuickLookUI.framework/PlugIns/Generic.qldisplay
lsregister: registered plugin /System/Library/Frameworks/Quartz.framework/Frameworks/QuickLookUI.framework/PlugIns/Image.qldisplay
lsregister: registered plugin /System/Library/Frameworks/Quartz.framework/Frameworks/QuickLookUI.framework/PlugIns/3D.qldisplay
l
........


I thought, despite the errors, that it might have done something so, I followed by


killall Dock

sudo mdutil -E /


and got the same "Error: unknown indexing state", so I still can't solve the problem


---


is there some way to clear indexing state to start from a clean slate?

May 19, 2022 9:46 PM in response to BDAqua

I have the same problem as zaj-carlosman.

After carefully following the process in terminal, and terminal listing hundreds of lines of data, I get this: 

Beckys-MacBook-Air-2017:~ beckycagen$ killall Dock

Beckys-MacBook-Air-2017:~ beckycagen$ sudo mdutil -E /

/:

Error: unknown indexing state.

Beckys-MacBook-Air-2017:~ beckycagen$ sudo mdutil -i on /

/:

Error: unable to perform operation.  (-400)

Error: unknown indexing state.


Still no spotlighting, finder searches, or mail searches. I need to go out of town soon with this laptop and without search it is incredibly frustrating.


Thank you.

May 20, 2022 8:53 AM in response to besnik88

I still get this after following your text: Beckys-MacBook-Air-2017:~ beckycagen$ killall Dock


Beckys-MacBook-Air-2017:~ beckycagen$ sudo mdutil -E /


/:


Error: unknown indexing state.


Beckys-MacBook-Air-2017:~ beckycagen$ sudo mdutil -i on /


/:


Error: unable to perform operation.  (-400)


Error: unknown indexing state.


Beckys-MacBook-Air-2017:~ beckycagen$ 

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 indexing not working

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