299

Spotlight has stopped showing any results for my Applications. I've tried reindexing and removing the index so it rebuilds it. No change. I've tried adding Applications to the Privacy tab and removing it, no change. I tried repairing disk permissions and redoing the above, no change. I've tried removing everything from the index except Applications and then I just get nothing for any search at all (except dictionary entries). I tried adding a symlink in my homedir to Applications and reindexing, but no change.

Any ideas on what to do? I'm running Snow Leopard. This is driving me crazy!

Update: I've noticed that when I start a reindex with sudo mdutil -E / and then immediately do a Spotlight search for an app that the app shows up temporarily until Spotlight gets disabled due to active indexing. After the indexing is done, the app entries go away.

bmike
  • 235,889
mix
  • 3,205
  • Just a quick check: have you gone into system preferences and gone into the spotlight tab and customised the search results tab? In that tab you can check which items will be shown in spotlight. If applications are checked, make sure the applications directory is in the right place and send me the location – Jamesg Sep 01 '12 at 09:27
  • 1
    yes, it's checked, listed first in the list, and is in /Applications – mix Sep 01 '12 at 09:35
  • Could that be related to http://apple.stackexchange.com/questions/96183/spotlight-wont-find-apps-after-appstore-updates-them? – pstadler Sep 16 '13 at 13:09
  • In my case rebuilding the Launch Service Database resolved the issues - https://discussions.apple.com/thread/8176120 – Faisal Feroz Feb 20 '21 at 09:01
  • Same happened to me. Just a hunch that some over aggressive system/cache cleanup was the cause – Manuel Hernandez Apr 16 '21 at 16:40

7 Answers7

450

Update Oct 1, 2021

In 10.12 (macOS Sierra) and newer, it appears to be enough to disable and reenable indexing:

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

Original Answer

Loading the metadata plist worked for me:

Turn off spotlight:

sudo mdutil -a -i off

Unload it:

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

Load It:

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

Turn on spotlight again:

sudo mdutil -a -i on

Now everything is being reindexed as expected.

Janosh
  • 1,101
Anil
  • 4,728
  • Loading metadata plist worked like a charm. Except I didn't have any metadata when I did it which I think was causing my issue. I skipped to the 'Load It' section and now it works like a charm thanks man! –  Sep 30 '14 at 03:11
  • @JustAnil +1. your answer fixed the issue I had with Mac App Store showing updates for uninstalled apps. Thanks. – Dipak G. Nov 19 '14 at 06:48
  • 3
    if after sudo mdutil -a -i on indexing is still disabled please look at this answer – Camilo Sanchez Aug 13 '15 at 03:36
  • 3
    When I try this I get this error Error: Index is already changing state. Please try again in a moment. regardless of how many times I try it / how long I wait. – Andrew Oct 01 '16 at 14:53
  • Dang. That works a treat. The nerd in me would love to know why that worked... I don't see how the plist could change between unloading/loading it... particularly with mdutil off. Any explanation? P.S. why isn't this the chosen solution? – Volte Dec 12 '16 at 15:25
  • 3
    This solution worked for me on macOS 10.12.2 (Sierra). – Sean Bearden Jan 14 '17 at 22:53
  • @CamiloSanchez - thanks, that solution worked! I just removed the /.metadata_never_index file from / directory before running the command sudo mdutil -a -i on /. However, for some reason it turns off again after rebooting and that file reappears. – mrk2010 Mar 07 '17 at 18:05
  • 9
    Here is another solution: https://discussions.apple.com/thread/7356551?start=0&tstart=0 – Mackelito Mar 15 '17 at 21:41
  • 1
    I was having the same problem with outlook for macOS ( Sierra ). The solution provided by @Mackelito worked for me. – luistm May 08 '17 at 07:26
  • 57
    I got a message saying Operation not permitted while System Integrity Protection is engaged while unloading, but apparently it's reindexing anyway and worked for me on 10.12.4. – Nobu May 13 '17 at 07:56
  • 89
    It worked. I DID NOT need to unload/load. All I did was turn it off and on. – mjezzi Jun 29 '17 at 14:48
  • @Mackelito 's link is quite handy! – AGamePlayer Aug 04 '17 at 16:03
  • I turned off, then tried to run the unload command, got some message about not being able to due to system integrity being enabled. so I turned the mdutil back to on, now it works. I don't know why, but, it works ! – teewuane Aug 23 '17 at 16:51
  • 3
    How can I check the status of indexing? – Petrus Theron Jan 17 '19 at 10:10
  • In my case this started happening after I created a new user (for the new verified Apple developer login) and deleted it afterwards. This keeps crashing spotlight as there are now files with the delete users UID. See here for more: https://discussions.apple.com/thread/6613687 – Kenneth Jun 18 '19 at 08:01
  • 1
    Just sudo mdutil -a -i off and sudo mdutil -a -i on does the trick on Mojave 10.14.6.

    As mentioned by @Nobu, the sudo launchctl unload -w /System.. command produced an error: /System/Library/LaunchDaemons/com.apple.metadata.mds.plist: Operation not permitted while System Integrity Protection is engaged

    – gerrytan Nov 12 '19 at 02:16
  • 1
    If this does not work, you may have too much emails in mail app. Un-select mail in spotlight index settings and do the above, your apps will show up. – ospider Nov 22 '19 at 04:41
  • I had the same problem this week (mac OS Monterey - MBP M1 Pro). I tested all command lines and operations I could find but it changed nothing. What resolved the problem for me was to free some space on my disk. My disk was full, I freed a lot of space and the apps finally showed up in spotlight two days after. – Paul Etienney Dec 15 '22 at 08:48
97

Had this issue and nothing worked until I rebuilt the index using this in the Terminal:

sudo mdutil -E -i on /

As an alternative you can also use a free app called Alfred which has a lot more features.

(I'm not affiliated with Alfred in anyway)

Hope this helps!

AntonioR
  • 1,071
  • +1 for Alfred...which just works. If it doesn't, it has some very easy-to-use Preferences and Settings interface. Not to mention, workflows. (I, too, am not associated with Alfred, just happier using it than a busted Spotlight). – harperville Jan 07 '17 at 17:16
  • 1
    This is the answer that worked for me when Spotlight stopped indexing my applications. The currently accepted answer did not. – inopinatus Sep 12 '17 at 22:12
  • 2
    Just typing sudo mdutil -E / did the trick for me on macOS 10.12.6 (Sierra) – Jakob Egger Oct 08 '17 at 18:11
  • When I first tried this, I got an error message about the index being read-only; but after I restarted my computer, this command worked, and fixed my index. – Mike Morearty Jan 23 '18 at 08:26
  • 2
    Alfred actually uses the Spotlight index, see no. 3 https://www.alfredapp.com/help/troubleshooting/indexing/ – Ronni Egeriis Persson Mar 12 '18 at 10:23
  • Alfred saves the day! Senseful’s solution wouldn’t work for me—Spotlight would not reindex. But reindexing with Alfred worked perfectly! Thanks! – Calion Sep 12 '20 at 04:05
  • alfred also use the index, it does not work for me :( – cheng yang Jun 30 '21 at 06:02
  • I'm actually here because Alfred has stopped indexing my Applications folder and that it looks like the problem is related to Spotlight. – Stuart Woodward Jan 28 '22 at 06:07
41

When I tried Anil's solution, I got:

sudo launchctl unload -w /System/Library/LaunchDaemons/com.apple.metadata.mds.plist
/System/Library/LaunchDaemons/com.apple.metadata.mds.plist: Operation not permitted while System Integrity Protection is engaged

Instead, I followed these instructions, and it worked:

  1. Go to System Preferences, Select Spotlight
  2. Go to the Privacy tab in the Spotlight system preferences
  3. Click the Plus button
  4. Press Shift-Command-C to reveal your hard drives (if they are not available otherwise), or simply navigate to your hard drive (most likely MacintoshHD)
  5. If you have more than one hard drive, hold the Command key and click your various drives to add them to your selection
  6. Click the “Choose” button to add them to the Privacy list
  7. Ignore the warning.
  8. Remove the hard drive by clicking the minus sign.
  9. Boom, no more sad days.
Senseful
  • 23,929
  • This worked for me. I was having trouble with the Slack.app application not being recognized as an application. After performing these steps the Slack app now works just like all my other applications in Spotlight. – Richard Hurt Jun 05 '17 at 13:49
  • I had the same problem with Safari, if you can believe it. I am in a highly secure corporate environment, and this is what I was allowed to do, and it worked. – Jeff Jun 05 '17 at 14:48
  • Just had this problem with Evernote and this solved it. Thank you @Senseful. – JamesWilson Jul 20 '17 at 03:11
  • This solution worked great! In fact I could not use the other ones because I cannot seem to be able to find the terminal without spotlight :P – kenik Mar 26 '18 at 21:57
  • @kenik You can find everything in the Finder app. – akashg May 11 '18 at 19:07
  • This worked great for me as I was booting from an external drive - by default I think external drives get excluded from spotlight search – Adam Diament Mar 22 '20 at 07:17
  • Thanks! This worked and fixed the problem I was having in seconds. – Stuart Woodward Jan 28 '22 at 06:09
8

Since macOS starting 10.15, all user data is on /System/Volumes/Data which is also where the .Spotlight-V100 folder is. To really force Spotlight to rebuild its cache, I've found this needs to be deleted. So I needed to do the following:

sudo mdutil -a -i off /
sudo mdutil -a -i off /System/Volumes/Data
sudo launchctl unload -w /System/Library/LaunchDaemons/com.apple.metadata.mds.plist

sudo rm -Rf /System/Volumes/Data/.Spotlight-V100/

sudo launchctl load -w /System/Library/LaunchDaemons/com.apple.metadata.mds.plist
sudo mdutil -a -i on /
sudo mdutil -a -i on /System/Volumes/Data
kjyv
  • 235
  • Finally this was the only thing that helped me. Had this issue since Catalina was released. Please note that I could not perform the launchctl steps nor remove the files from terminal because of System integrity protection. Instead I opened /System/Volumes/Data in Finder, enabled showing hidden files, and moved the Spotlight folder to trash. – alain.s Nov 20 '20 at 10:40
  • 2
    I found I did not actually have to delete the .Spotlight-V100 directory. Simply running the two mdutil commands on the /System/Volumes/Data directory fixed the problem. Thanks! – jlyonsmith Feb 28 '21 at 18:43
  • 1
    In my case, the problem was that I didn't have Spotlight indexing enabled for /System/Volumes/Data at all, so I simply had to re-enable indexing via: sudo mdutil -i on /System/Volumes/Data. Then it started working again. – GDP2 Oct 18 '22 at 22:31
2

Here's a BASH script to automate the boring stuff based on @AntonioR and @Anil's answers: : https://gist.github.com/Obaied/d8afbbce1b73481fbd0410c0897b6a87

#!/bin/sh
# Reference: https://apple.stackexchange.com/questions/62715/applications-dont-show-up-in-spotlight

sudo mdutil -a -i off
sudo launchctl unload -w /System/Library/LaunchDaemons/com.apple.metadata.mds.plist
sudo launchctl load -w /System/Library/LaunchDaemons/com.apple.metadata.mds.plist
sudo mdutil -a -i on /
Solidak
  • 211
2

Have you tried removing the spotlight.plist in your user preferences. Similar problem with 10.7.5 and re-indexing wouldn't work until I moved the spotlight.plist to the desktop to be safe and then did a sudo mdutil -E / If that works you can delete the old .plist file.

1

For me, it was as simple as opening terminal (use command + space, then type terminal)

Then simply

sudo mdutil -a -i off

It will ask for you password, enter it and hit enter.

Then

sudo mdutil -a -i on
stevec
  • 4,955
  • Mind, if the problem one is trying to fix is that Spotlight doesn't find applications, then command+space followed by typing terminal may not be so much help at that moment :) – Charles Duffy Apr 05 '23 at 13:22
  • @CharlesDuffy That's true. In that case, open with the terminal command open -a terminal -n :D – stevec Apr 05 '23 at 13:28