Reindexing Outlook Identity

signetmac
Contributor

I don't know if many of you have this issue, but occasionally someone comes to me, particularly after a Outlook DB rebuild, and complains that the search feature on their Outlook no longer works.

I decided to offer them the following script through Self Service:

#!/bin/bash

loggedInUser=`ls -l /dev/console | awk '{ print $3 }'`

/usr/bin/su $loggedInUser -c "/usr/bin/mdimport ~${loggedInUser}/Documents/Microsoft User Data/Office 2011 Identities"

...and was wondering if anyone has a better way.

Admittedly, I'm not the most talented bash scripter, and specifically would like to identify the "Main Identity" folder they are currently using, so as not to re-index the several legacy Identity folders they have left over after previous rebuilds.

You'd think off the bat, 'Well, why not put "/Main Identity" at the end, knowing that the names of previous copies will be suffixed with a date?' but in my experience, I've run across people who have selected legacy rebuilds in the Database Rebuild utility, and from that point forward use as their primary something differently named than merely "Main Identity"

3 REPLIES 3

pblake
Contributor III

When I have had that issue, the search in Outlook is leveraging Spotlight. So I rebuild the Spotlight index, and that usually fixes the issue.

sudo mdutil -E /Volumes/Macintosh HD/

scottb
Honored Contributor

As @pblake][/url stated, Spotlight is the issue there. When you rebuild an Outlook identity, it's going to take some time for that to finish up (Spotlight). If you try to search before it's finished, or if Spotlight's index is out of date (also fixed by the above, but we use "sudo mdutil -E /" as everyone's names are different) the search will fail.
We have users with Identities that are HUGE - 10's of GBs and it doesn't re-index very quickly on some Macs (read, older models).

signetmac
Contributor

Thank you for your responses, gents.

It's my understanding, and experience, with mdimport is that it allows us to target a specific directory for Spotlight reindexing rather that scrap the whole computer's index and start from scratch... saving tons of time over:

mdutil -E -i on /