Spotlight reports "Indexing and searching disabled" in Lion

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) :(


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.


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

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