Spotlight indexing, not a newbie topic rather deep dive debug

Hi there Apple Community,


I just had a call with Apple Support regarding my Spotlight indexing problem and it seems that I just got walked through a script with 0 added value despite listing errors from Console and what I already did.

It was a disappointing interaction (felt as if I was talking to AI) but I hope the forums are a bit different :)


My problem:

  • Spotlight indexes only some files.../Applications not, Emails not...and so on
  • If I go into mdutil and I manually index a folder..then the results will show for a while (until the mds or mdmworker process or whatever does a refresh and then I am back to square one)


MacBook Pro 15”, macOS 10.13

Posted on Mar 21, 2020 4:22 PM

Reply

Similar questions

5 replies

Mar 21, 2020 9:36 PM in response to mhvrr

Are there Drives that can be excluded from Spotlight to help diagnose?


You done some of this but just for completeness...


How to rebuild the Spotlight index on your Mac

If searching your Mac doesn’t return expected results, rebuilding the Spotlight index might help.


1. Choose Apple menu () > System Preferences, then click Spotlight.

2. Click the Privacy tab.

3. Drag the folder or disk that you want to index again to the list of locations that Spotlight is prevented from searching. Or click the Add (+) button and select the folder or disk to add.
To add an item to the Privacy tab, you must have ownership permissions for that item. To learn about permissions, choose Help from the Finder menu bar, then search for “permissions.”

4. From the same list of locations, select the folder or disk that you just added. Then click the Remove (–) button to remove it from the list.

5. Quit System Preferences. Spotlight will reindex the contents of the folder or disk.


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 /

Mar 22, 2020 4:34 AM in response to mhvrr

Found from Microsoft a tool:

OutlookSearchRepair

https://docs.microsoft.com/en-us/outlook/troubleshoot/outlook-for-mac/useful-tools


I think it triggers mdimport in the background but regardless of what it does under the hood, everything got fixed afterward so now my indexing is back to normal.


Thanks again BDAqua, also for the deep dive part:)

I hate it when I stumble upon 1st level support and am faced with a script rather than a logical conversation.

You saved the day.

Mar 22, 2020 1:44 AM in response to BDAqua

Hi,


The last part with re-registering the plugins did the trick. No more errors in the logs and indexing started working.

Thank you!!!!


Outlook Email Indexing is still amiss though...aside from the case where I manually do an mdimport on /Users/mtanases/Library/Group Containers/UBF8T346G9.Office and the other Outlook stuff I found.


Do you happen to have a magic trick up your sleave for this one too?


Thanks,

Mihai

Mar 21, 2020 4:23 PM in response to mhvrr


  • I tried Safe Mode, resetting NVRAM, resetting SMC
  • Going into Console displays
  • - LaunchServices: store or url (null) was nil -10813, retrying
  • - LaunchServices: Database mapping failed with result -10813, retries = 8

These errors are mega helpful as for a Unix admin like me they say absolutely nothing. There's no hint as to what URL is failing to index.

I assume Spotlight finds some corrupted files and then goes in a loop until it finally gives up on indexing.

sudo fs_usage |grep -i mds = shows quite some usage so it is doing something (but even what I see that it is doing do not find in its indexing)

  • removing the Spotlight folder (index) via Terminal, doing mdutil -a -i off and then -E -i on did not help


I am almost certain that this is a file corruption issue that confuses mds/mdmworker, the only problem is...I don't know how to activate a more comprehensive debug level (LOG LEVEL) so that I see what the URL error really refers to (then I can delete the file).

Apple Support is also not helping me move forward as their 1st level just reads a script and tells me the same steps in a loop regardless of my problem description or what I tried (or the fact that I already tried what was in the interaction / chat script :) ).

  • Forgot..also booted into Recovery -> tried First aid



Anyone else stumbled upon this / having more insight or more deep-dive?


Thank you in advance!

This thread has been closed by the system or the community team. You may vote for any posts you find helpful, or search the Community for additional answers.

Spotlight indexing, not a newbie topic rather deep dive debug

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