I’ve had one more case recently: an employee reported that his outlook wouldn’t search any item for the last three weeks or so. Rebuilding indices didn’t help and moreover he was not using cached outlook mode. Well, while my search seemed to be ok, I needed to reproduce the problem somehow, so I went nuts and removed cached mode too. Bingo! My search results were restricted by the period from the same three-weeks-ago and to the beginning of time. No results from yesterday or last week. Considering the fact that mailboxes, both the employee’s and mine were in the same storage group I decided that it was the server index who was responsible for that tragedy (do you know where is each your mail at the moment, by the way?).
How can we check if something is wrong with the index on a server? The answer was easy to find: Test-ExchangeSearch for Exchange 2010 or for 2007. Running the command for my account returned the following:
ResultFound : False
SearchTime : –1
Obviously something went wrong with index. How can we restore it? Again, easy: here is the KB which was found at no time. So I just got to my server and run the script ResetSearchIndex.ps1 for the problematic DB from Exchange folder. Of course, deleting index and recreating it gives a server hard time in terms of processor usage and IO, so I did it in non-working hours. And just in case you, like I, need to know if the index is being rebuilt or has it been rebuilt, you will need to look at a counter for the DB which you are reindexing. The counter is MSExchange Search Indices – Full Mode Crawl Status. You can track it for a particular DB or for _Total. If it is 1 then you have Full Crawl being performed. If it is 0, then crawls have stopped. And after they stopped, you can check again if you have solved your problems with search:
[PS] C:Windowssystem32>Test-ExchangeSearch domainnameusername
I definitely did =)