How to Rebuild the Spotlight Index on Your Mac

Discussion in 'Mac Blog Discussion' started by MacRumors, Nov 17, 2018.

  1. MacRumors macrumors bot

    MacRumors

    Joined:
    Apr 12, 2001
    #1
    [​IMG]


    [​IMG]
    Apple has enhanced Spotlight search in macOS in recent years, with the addition of Spotlight Suggestions allowing it to tap into a variety of online data sources like weather and sports. Nevertheless, helping you find apps, documents and other files stored on your Mac is still what Spotlight does best.

    That's not to say its core function is infallible, however. If Spotlight can't find files that you know exist on your Mac, or if it stops prioritizing results based on your earlier searches, then it's probably a sign that your system's search index is damaged somehow.

    If you're experiencing odd behavior when using Spotlight, you should try rebuilding its search database index. There are Terminal commands that will do the job, but you can achieve the same result via the regular macOS user interface in just a few quick steps. Here's how.

    1. Select System Preferences... from the Apple (?) menu at the top left of your screen.
      [​IMG]

      Click the Spotlight pane.
      [​IMG]

      Click the Privacy tab.
    2. Click the Add (+) button.
      [​IMG]

      Select the folder or disk whose index you wish to re-build, then click Choose. Alternatively, drag the folder or disk into the list. We've chosen Documents in our example.
      [​IMG]

      In the same list, click the folder or disk that you just added and then click the Remove (-) button.
      [​IMG]

      Click the red traffic light button to close System Preferences.
    Once you've completed these steps, Spotlight will begin reindexing the contents of the folder(s) or disk(s) you chose, which may take some time and a few processor cycles. Depending on which version of macOS you're running, you may see a rebuild progress indicator in Spotlight's menu bar item. With a bit of luck, your Spotlight problems will have been resolved once indexing is complete.

    You can also perform a system-wide re-index of the Spotlight database, among many other optimizations, using Titanium Software's free Onyx utility, which is available for all recent versions of macOS.

    Article Link: How to Rebuild the Spotlight Index on Your Mac
     
  2. Baletin macrumors member

    Joined:
    Apr 14, 2012
    #2
    I've tried this rebuild previously and found it did not change anything.
    Anyone with different experience?
     
  3. Weaselboy Moderator

    Weaselboy

    Staff Member

    Joined:
    Jan 23, 2005
    Location:
    California
    #3
    You can also just run this command in Terminal and it will do a system-wide Spotlight reindex.

    Code:
    sudo mdutil -E /
    One issue I have noticed a Spotlight reindex will often fix is if you are getting an incorrect readout for Storage in System Report. If the Spotlight index is corrupted it will make that storage readout all wrong and a reindex can fix it.

    Screen Shot 2018-11-17 at 11.03.51 AM.png
     
  4. macdaddy44 macrumors newbie

    Joined:
    Nov 17, 2018
    #4
    This is a more extensive rebuild as it removes a possibly corrupt index database -

    • mdutil -i off /
    • sudo rm -rf /.Spotlight-V100
    • sudo rm -rf /.Spotlight-V200
    • mdutil -i on /
    • mdutil -E /
     
  5. Spidder macrumors member

    Joined:
    Dec 31, 2012
    #5
    rm: /.Spotlight-V100: Operation not permitted

    Why?
     
  6. macdaddy44 macrumors newbie

    Joined:
    Nov 17, 2018
    #6
    What version of the OS? Last time I did this it was on Sierra. Also, did you use sudo rm?
     
  7. Spidder macrumors member

    Joined:
    Dec 31, 2012
  8. macdaddy44 macrumors newbie

    Joined:
    Nov 17, 2018
    #8
    I wonder if you need to turn off SIP under High Sierra and Mojave. That would be a real pain but I know you have to do it to manually delete files from a Time Machine backup
     
  9. kwikdeth macrumors 6502a

    Joined:
    Feb 25, 2003
    Location:
    Tempe, AZ
    #9
    Onyx is a great utility, been using it for years. It also gives you access to enable a bunch of other hidden settings and options. For example, One option I like to enable is turning launchpad's background to greyscale. I find this makes it easier and faster to locate items on the launchpad that I don't frequently access.
     
  10. Mr_Brightside_@ macrumors 68030

    Mr_Brightside_@

    Joined:
    Sep 23, 2005
    Location:
    Toronto
    #10
    Weird timing. I was having an issue with two of my Sierra Macs where the Spotlight window would disappear right after beginning to type. I forced a re-index and it seems to have fixed the issue.
     
  11. JosephAW macrumors 68000

    JosephAW

    Joined:
    May 14, 2012
    #11
    Too bad you can easily rebuild in iOS. You have to do the reset all settings and it looses some data.
     
  12. djlythium macrumors 6502a

    djlythium

    Joined:
    Jun 11, 2014
    #12
    I never knew this was possible.

    I love these tutorials!
     
  13. MarcKerr macrumors newbie

    MarcKerr

    Joined:
    Mar 14, 2012
    Location:
    Indiana
    #13
    In the Terminal all you need is
    sudo mdutil -E /
    It is unnecessary to try and remove the .Spotlight directories. You do need to check the Spotlight System Preference to make sure nothing is listed in the Privacy tab. Anything there prevents that item from being indexed. The mdutil command will not change the privacy settings.
     
  14. ignatius345 macrumors 68000

    Joined:
    Aug 20, 2015
    #14
    Interesting! One of my Macs was showing different amounts of free drive space in different user accounts. It never occurred to me that Spotlight might have an effect...
    --- Post Merged, Nov 18, 2018 ---
    Yeah, OnyX is amazing. I find it super useful to change certain parameters, like how screenshots are named and what format they're saved in.
     
  15. chaloots macrumors newbie

    chaloots

    Joined:
    Sep 10, 2006
    Location:
    Lafayette, LA
    #15
    Running Sierra here. A problem I've been experiencing is that prior to loading an external disc or thumb drive I'll pull up Spotlight so as to add that drive to the Privacy Tab to prevent its being indexed. More than half of the time I try this I have to wait for Spotlight's blue status bar to complete, as if it's already in the process of building or re-building.

    What might be the cause, or better yet, a solution for this?
     
  16. mudflap macrumors regular

    mudflap

    Joined:
    Aug 24, 2007
    Location:
    Chicago
    #16
    I encountered my very first Spotlight problem last month. After applying the second-to-last High Sierra update I noticed my searches stopped showing any results. The file could be right in front of my eyes but Spotlight couldn't see it. I tried all of these tricks and they worked briefly but then the problem would return — and of course this happened while I was working on a magazine with hundreds and hundreds of photos.

    I tried installing the last High Sierra update but my system would get stuck on the black screen with the cursor when restarting to complete the install. Combo update didn't work either. I finally said screw it and updated to Mojave and all the issues went away.

    Weird.
     
  17. ateslik macrumors regular

    Joined:
    Oct 18, 2008
    #17
    when you combine spotlights PDF indexing with the Fujitsu Snapscan with OCR and coverflow, the results are amazeballs.

    Apple should advertise this functionality. It’s an amazing paperless workflow. If apple added AI bill, business card, and receipt recognition to spotlight that would be even better.

    That’s all I got to say about spotlight! Long live coverflow!
     
  18. Baletin macrumors member

    Joined:
    Apr 14, 2012
    #18
    Which SnapScan do you use, please?
     
  19. StellarVixen macrumors 6502a

    StellarVixen

    Joined:
    Mar 1, 2018
    Location:
    Earth
    #19
    There is no better search engine than Spotlight. I love Mac OS. ❤️❤️❤️
     
  20. mgauss7 macrumors regular

    mgauss7

    Joined:
    Apr 23, 2009
    Location:
    Miami
    #20
    There should be a menu with 100 choices like at a restaurant:

    1) Odd behavior when using Spotlight? Click to rebuild its search database index.
    2) ...
     
  21. Digital Dude macrumors 6502

    Digital Dude

    Joined:
    Oct 12, 2008
    Location:
    Arizona where freedom still means something
    #21
    Step process didn't work for me. Once I added 'Documents' folder and deleted, I was never presented with the red traffic sign
     
  22. VictorTango777 macrumors 6502

    Joined:
    Oct 28, 2017
    #22
    It seems that Apple assumes Mac users only need to search Mac formatted drives that are connected directly to Mac computers running Mac OS. Forget about shared folders on Windows servers or read-only volumes such as NTFS drives or DVD media. Even with simple filename based searches, Mac OS 9 from 20 years ago or even Unix find seems to find filenames better than Spotlight when searching "non Apple approved" volumes.

    Also, what search engine does Apple use on their own Support website? Trying to search for a simple phrase returns hundreds of pages of irrelevant results. It also seems like their website search uses implicit "OR" instead of "AND" for searches containing multiple words. It's pathetic that I have to use an external Google search to find stuff inside Apple's own website.
     
  23. MacBH928 macrumors 68030

    MacBH928

    Joined:
    May 17, 2008
    #23
    Is it possible to make Spotlight NOT index external HDDs or connected storage?
     
  24. Weaselboy Moderator

    Weaselboy

    Staff Member

    Joined:
    Jan 23, 2005
    Location:
    California
    #24
    Just add the drive to this Privacy panel in System Preferences.

    Screen Shot 2018-11-20 at 7.44.37 AM.png
     
  25. MacBH928 macrumors 68030

    MacBH928

    Joined:
    May 17, 2008
    #25
    Thank you, I added the Macintosh HD to the privacy panel and then let it out to rebuild the index. Nothing seemed to happen. In fact, Spotlight was able to search the HDD even when the Macintosh HD was in the privacy panel.
     

Share This Page