Outlook for Mac: How to rebuild search indexes

Today a colleague asked me for something I sent out via email. A search for the appropriate keywords in Outlook only turned up year-old emails (we use Outlook at work). Adjustments to the search scope — current folder, subfolders, all folders — didn’t make a difference. I eventually had to use the outlook web access to find the email.

Outlook for Mac uses the macOS native Spotlight search as its search index. It turns out these Spotlight search indexes were out of date or corrupted for the relevant Outlook directories. Not sure why.

Here is how to rebuild the Spotlight search indexes for Outlook for Mac 2016 (run in a terminal):

mdimport -d1 \
  -g "/Applications/Microsoft Outlook.app/Contents/Library/Spotlight/Microsoft Outlook Spotlight Importer.mdimporter" \
  "$HOME/Library/Group Containers/UBF8T346G9.Office/Outlook/Outlook 15 Profiles/Main Profile/"

Rundown of the command:

  • mdimport: command to import files into the macOS metadata datastore (aka Spotlight).
  • -d1: enable debug level 1.
  • -g <...>: load the plugin at provided path.
  • "$HOME/...": path to the directory to index. Main Profile is the default profile, yours might be called differently.

This command might take a while to complete. After that Outlook found the emails right away (might have to quit and restart Outlook first).

More posts here.