SharePoint 2010 Search enables you to add search synonyms via XML configuration files on the server. The configuration is well described on TechNet and seems pretty straighforward. There are sample files in the installation, that you can use as a starting point, but straight away, we saw some challenges related to governance and deployment:
We therefore decided to script the rollout, taking a CSV file as input. CSV is easily edited using Excel, and PowerShell is great at parsing CSV and writing XML. This way, both problems could be easily solved. But, as we started trying this out, we ran into additional challenges:
The XML schema problem appears in the event viewer and looks like this:
We found that removing the XML namespace reference at the start of the XML file solved the problem.
To make a long story short, we have created a script which handles everything you need:
Configuration is done via a simple PowerShell file which is passed as input to the main script. A couple of things to note regarding configuration:
Download the attached zip for the complete source. Thanks to my colleague Stig Lytjohan for doing much of the hard work!
Enjoy!