Thursday, April 28, 2011

Adding new nicknames to SharePoint People Search

Out of the box SharePoint 2010 comes with a pretty good people search. This is due to a combination of phonetic rules and a vast list of nicknames. Out of the box the US English nickname list consists of over 14.000 nickname mappings, ensuring good results when trying to find people.

But what if you are located in a different part of the world, speaking some obscure language like Norwegian, which is my native tongue, and where names are sounding nothing like English ones? What then?
Phonetics and nicknames are handled by the Microsoft Speech Platform. Default only en-us is installed, but you can download and install the runtime for your particular language. Your mileage seems to vary with how good the other language runtimes actually are, and my tests show that the English one usually gives the best results.

Still, you might have to add some nick names of your own. Here’s how:

SharePoint PowerShell has a command called New-SPEnterpriseSearchLanguageResourcePhrase. This command can take a Type parameter of Nickname (which for some reason is not listed on the TechNet page, but is documented on the Get version of the same command).

If I wanted to add the nickname slick for my own name, and vice versa I would execute the following PowerShell Commands:

$ssa = Get-SPEnterpriseSearchServiceApplication FASTQuery

New-SPEnterpriseSearchLanguageResourcePhrase –Name mikael -Language "en-US" –Type "Nickname" –Mapping slick -SearchApplication $ssa

New-SPEnterpriseSearchLanguageResourcePhrase –Name slick -Language "en-US" –Type "Nickname" –Mapping mikael -SearchApplication $ssa

FASTQuery is the name of my Query SSA. Also note the Language parameter. Your query language has to match this in order for the nicknames to be used, and my suggestion is to set this to for the language you choose to use for phonetics and nicknames.

Then in order to re-generate the language files run the command:

Start-SPTimerJob -Identity "Prepare query suggestions"

And your nicknames should be up and running from the search page.