You can make a difference in the Apple Support Community!

When you sign up with your Apple Account, you can provide valuable feedback to other community members by upvoting helpful replies and User Tips.

Looks like no one’s replied in a while. To start the conversation again, simply ask a new question.

Can't get spotlight to work properly - only searches some of the classes of available datga

Not sure why this is happening: Apotlight - for all users accounts on this machine - is not showing search results that should come from Events and Reminders (Calendar), Contacts, and Documents (and probably others...)


Yes these categories are selected / checked in each user's Spotlight preferences. I tried unselecting and then reselecting, to no effect. I also tried using mdutil to reset everything, all the way up to doing


mdutil -i off /

sudo rm -rf /.Spotlight-V100. (yes, this is where the database is found)

mdutil -i on /

mdutil -E /


No luck..... is driving me slowly crazy .... Is there something else I should try? Could any anti-virus stuff be getting in the way? I also can't honestly say when this started to not work ... I first realized I had an issue when I realized I could no longer search for events in the calendar app...

iMac 27″, macOS 10.13

Posted on Aug 26, 2021 1:13 PM

Reply
Question marked as Top-ranking reply

Posted on Aug 26, 2021 1:19 PM

Hi Ian,


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.

Similar questions

4 replies
Question marked as Top-ranking reply

Aug 26, 2021 1:19 PM in response to IanSGraham

Hi Ian,


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.

Aug 28, 2021 8:02 AM in response to BDAqua

I followed your suggested following steps, with the following not entirely successful results.


A) Reboot into safe mode - the problem still exists.


B) Reboot into normal mode and re-indexed the drive using sudo mdutil -E / (I only have one mounted drive). The problem still exists.


C) Opened terminal and ran the five commands you suggested (reproduced below), but with the following changes: I have to 'su admin' to run 'sudo' commands as my user account does not have admin privileges, so I opened two terminal windows: one to 'su admin' and run the sudo commands, and the other to run the first command (lsregister, step 1.) and "killall Dock" (step 3.) under my user account.


  1. /System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/LaunchServices.framework/Versions/A/Support/lsregister -kill -r -domain local -domain system -domain user
  2. 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
  3. killall Dock
  4. sudo mdutil -E /
  5. sudo mdutil -i on /


Results: Under my user account, several categories of information (Contacts, Presentations, Folders, Documents) that were formerly missing from Spotlight search are now displayed . Yay! But the specific one I was looking for - Events and Reminders - (Calendar stuff), is still missing. Similarly, 'Search' inside the Calendar app does not work.


However - If I log in under a second user account user (user2) for which Spotlight was also broken before doing this fix, Events and Reminders information is shown in Spotlight and is searchable in the Calendar App.


So the fix almost worked .... I tried doing this twice, and still have the same problem (Events and Reminders not appearing in Spotlight under my own user account).



Can't get spotlight to work properly - only searches some of the classes of available datga

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