Spotlight reports “Indexing and searching disabled” in Lion

https://apple.stackexchange.com/questions/24401/spotlight-reports-indexing-and-searching-disabled-in-lion

Spotlight reports “Indexing and searching disabled” in Lion
Asked 10 years, 9 months ago
Modified 1 year, 2 months ago
Viewed 48k times
40
19

Lion keeps “losing track” of Spotlight information. Directories and Applications disappear, full text searches stop working, etc. I seem to need to re-index it once a week or so.

However, now it appears to not work at all.

Running

sudo mdutil -i on /

from the Terminal I get a message

“Indexing and searching disabled.”

I have tried trashing preference files, deleting the whole V100 folder, repairing permssions, etc but Spotlight still thinks indexing is turned off on my entire Volume (Yes have added/deleted whole disk from Spotlight’s privacy preferences”).

In the console I have quite a few errors that look like this

mds: (Error) Server: Disabled store registered for scope “/Applications”

However, I do not know how to tell it to re-enable that scope as mdutil gives an error when I try to turn on indexing and gives an error when I try to delete the index

EDIT: I reinstalled Lion. It did not fix the problem(s) 🙁
macos
spotlight
Share
Improve this question
Follow
edited Jun 9, 2012 at 22:11
user avatar
Cajunluke
17.3k77 gold badges5252 silver badges7171 bronze badges
asked Sep 7, 2011 at 17:30
user avatar
lemonginger
1,73833 gold badges1616 silver badges2626 bronze badges

Are you using some “cleanup” tool by chance? Some of them are overly aggressive and delete the spotlight index. –
Ingmar Hupp
Sep 7, 2011 at 17:38
nope, no cleanup tools. –
lemonginger
Sep 7, 2011 at 17:41
You could try flushing your cache and rebuilt it with the following command: sudo mdutil -pEsav. The command you are running just turns it on, but it may be chocking for a different reason. How much space do you have free on the drive (how much taken)? And what are the errors you receive from mdutil? – user10355
Sep 7, 2011 at 20:35

I second running sudo mdutil -pEsav. My timemachien drive was constantly being indexed. After running that and waiting for spotlight to finish the rebuild I had no more problems. –
cftarnas
Sep 7, 2011 at 20:41
As mentioned, that doesn’t work because Spotlight thinks it is disabled. Running the above command gets me: Indexing and searching disabled. Error: datastore publishing not implemented. –
lemonginger
Sep 7, 2011 at 21:27

Show 3 more comments
10 Answers
Sorted by:
35

I had the exact same problem, with all solutions above failing identically. Then I reexamined the directory listing for / and found a hidden file .metadata_never_index in the root directory. I removed this file and was able to turn spotlight on again with mdutil -i on /.

mds is now reindexing the hard disk, all looks good for now.
Share
Improve this answer
Follow
edited Jun 9, 2012 at 22:11
user avatar
Cajunluke
17.3k77 gold badges5252 silver badges7171 bronze badges
answered Dec 30, 2011 at 18:31
user avatar
harryn
36633 silver badges22 bronze badges

I had this same problem after imaging. This solution worked for me :)! More than a year later. –
Ethabelle
Aug 23, 2012 at 17:35
THANK YOU! Been trying to get this to work for a couple months on work laptop. I did sudo rm .metadata_never_index, then ran your mdutil -i on / and it said “Indexing enabled.” Now I finally get the indexing graph! –
neoscribe
Feb 7, 2015 at 0:52
This fixed it for me as well, however the issue comes up again after I rebooted. The .metadata_never_index file reappeared in /. However, it’s possible that the reason is I simply ran the command sudo mdutil -a -i on (without specifying “ at the end). –
mrk2010
Mar 7, 2017 at 18:07
1
This solution worked for me on a fresh install of macOS Sierra 10.12.6, December 2017 –
lacy
Dec 4, 2017 at 19:43

Add a comment
27

sudo mdutil -i off /
sudo rm -rf /.Spotlight*
sudo mdutil -i on /
sudo mdutil -E /

1 – turn indexing off

2 – delete Spotlight folder

3 – turn indexing on

4 – rebuild

Does this help?

Also it seems you could use these commands:

sudo mdutil -a -i off
sudo mdutil -a -i on

Share
Improve this answer
Follow
edited Oct 27, 2011 at 7:06
answered Sep 7, 2011 at 21:05
user avatar
maggix
54333 silver badges77 bronze badges

No, when I try that on any Volume or subset of a Volume I get the following, as mentioned Indexing and searching disabled. –
lemonginger
Sep 7, 2011 at 21:28
1
I know it has something to do with the MDS error messages in the log (mds: (Error) Server: Disabled store registered for scope XXXX) but I don’t know why/how those are disabled –
lemonginger
Sep 7, 2011 at 21:29
1
@lemonginger: Step 2,rm -rf /.Spotlight*, fails with “permission denied”. I’m stuck. –
orome
Oct 27, 2011 at 2:34
Try with sudo rm , I edited my above post –
maggix
Oct 27, 2011 at 7:07
@maggix: I’d tried that too (good suggestion), but it also fails. –
orome
Oct 27, 2011 at 21:13

Show 2 more comments
11

The other solutions didn’t work for me, however the following was the culprit in my case.

Make sure your root/main hard drive isn’t in the “privacy” settings for spotlight. For some reason I had the whole hard drive under the “Prevent spotlight from indexing the following locations” list.

You can access this section from System Preferences -> Spotlight -> Privacy
Share
Improve this answer
Follow
answered Nov 18, 2013 at 12:29
user avatar
djhworld
21022 silver badges44 bronze badges

This was the key for me. The volume I wanted to index was in the Privacy window. Clicking minus (-) removed it. Then I could apply the steps outlined by maggix. I had to ‘enable’ twice, once for searching, and then for indexing. Same command both times: sudo mdutil -i on / –
Dickster
Nov 20, 2017 at 19:37
WARNING: I have a two-system hard-disk divided into two Volumes. When I add the volume I’m NOT using to the Spotlight -> Privacy panel, I discover it appears in the OTHER Volume’s Privacy panel as well. So when I restart onto the OTHER Volume, it’s in its own Privacy panel?!! NOT what I expected, especially since each Volume has its own .Spotlight-V100 directory. Is this an Apple bug? –
Dickster
Nov 20, 2017 at 20:36
This solved the issue for me! 🙂 Thanks! 🙂 –
Muhammad bin Yusrat
Apr 16, 2020 at 6:41
The unique solution that works for me! Thank you so much!! –
PRVS
Dec 5, 2020 at 10:12

Add a comment
5

sudo mdutil -i off /
sudo rm -rf /.Spotlight*
sudo rm -rf /.metadata_never_index
sudo mdutil -i on /
sudo mdutil -E /

A combination of the above worked for me. Step 3 was the big one. Got rid of the “Indexing and searching disabled.” message. Then steps 4 and 5 worked as expected.

turn indexing off
delete Spotlight folder
delete metadata file
turn indexing on
rebuild

Share
Improve this answer
Follow
edited Nov 19, 2014 at 17:44
user avatar
jherran
12.7k1111 gold badges5252 silver badges7272 bronze badges
answered Nov 19, 2014 at 17:13
user avatar
kmagill
5111 silver badge22 bronze badges

this worked for me. –
dirkk0
Jun 28, 2017 at 21:24

Add a comment
3

After all of the initial troubleshooting steps:

Rebuild the index
Attempt in another user account
Dump prefs/cache and start over

I found the issue lied in what was enabled/disabled. In terminal, I ran “mdutil -sa” and got:

/:
Indexing enabled.
/Groups:
Indexing disabled.
/Shared Items/Public:
Indexing disabled.
/Users:
Indexing disabled.
/Users/sarah/Documents:
Indexing enabled.

I noticed “/Users: Indexing disabled.” That’s the problem there. The fix: “sudo mdutil -i on /Users”. After that, it re-indexed /Users, which took significantly longer than it had before, and before it was finished, it was searching my Mail!
Share
Improve this answer
Follow
answered Apr 16, 2012 at 20:54
user avatar
Jay
3111 bronze badge
Add a comment
3

This can also be caused by getting stuck in safe mode. To fix that, you need to reset the NVRAM by holding down the Command ⌘, Option ⌥, P, and R keys immediately after rebooting (before the gray screen appears).
Share
Improve this answer
Follow
edited Jun 10, 2012 at 3:16
user avatar
daviesgeek
35.7k5151 gold badges154154 silver badges200200 bronze badges
answered Jun 9, 2012 at 14:10
user avatar
webdefender
3111 bronze badge
Add a comment
1

I noticed this issue after my iMac installed the software update 10.7.4 to my machine. Most of the suggested command-lines would produce ‘Indexing and searching disabled’. sudo mdutil -pEsav gave me ‘datastore publishing not implemented.’

Below is the solution that worked:

edit /etc/hostconfig
add the line 
SPOTLIGHT=-YES- at the bottom (this line was missing)
reboot

(after reboot make some soup while your machine prepares the index)
Share
Improve this answer
Follow
answered Aug 13, 2012 at 22:14
user avatar
danfelabs
11122 bronze badges
Add a comment
1

Only the combination of -E and -i on worked for me:

sudo mdutil -E -i on /Volumes/blah

Share
Improve this answer
Follow
answered Mar 14, 2018 at 11:08
user avatar
julifos
1111 bronze badge
Add a comment
0

This worked for me: Re-enable Spotlight Indexing

sudo launchctl load -w /System/Library/LaunchDaemons/com.apple.metadata.mds.plist

Share
Improve this answer
Follow
edited Aug 17, 2017 at 9:12
user avatar
grg♦
185k4242 gold badges320320 silver badges439439 bronze badges
answered Aug 17, 2017 at 8:10
user avatar
Jeremy
11

While this link may answer the question, it is better to include the essential parts of the answer here and provide the link for reference. Link-only answers can become invalid if the linked page changes. –
grg

Aug 17, 2017 at 9:13
Fixed my problem. Thanks –
user20072008
Jul 29, 2020 at 5:24

Add a comment
0

I’ve tried for days about every solution out there for Big Sur, and the combination of these steps seemed to solve it for me. Trust me I didn’t want do disable system integrity either but it’s the only thing that worked:

Disable system integrity (restart -> hold cmd + r -> select utilities terminal -> csrutil disable -> restart again)
run

sudo rm /System/Volumes/Data/.metadata_never_index

run

sudo launchctl unload -w /System/Library/LaunchDaemons/com.apple.metadata.mds.plist

run

sudo launchctl load -w /System/Library/LaunchDaemons/com.apple.metadata.mds.plist

Reenable system integrity csrutil enable following steps in step #1

Specifically the problem I had was I could not search applications. As you can see in the image, I can now see the application and it will successfully open it. Also, notice the index loading indicator:

enter image description here

Linux、Netatalk、Samba、NFSを使用したファイルサーバーについて研究・運用しています。

fsをフォローする
参考リンク

コメント