SharePoint Blog

How to programmatically search for the Index Component in SharePoint 2013

At the company I work for, we are going to start working with synonyms in our Search results (we are still on SharePoint 2010). The synonyms will be maintained by our Content Editors team and therefore I decided to let them maintain the synonyms in the term store (Managed metadata service application), as it is done in SharePoint 2013. Every night a timer job will run to read the term store and to create the tsenu.xml file and to copy it to the \Microsoft Office Servers\14.0\Data\Office Server\ApplicationsGUID-query-0\config\tsenu.xml folder.

When our code goes in production, it goes through a DTAP process, meaning that our code needs to be deployed on dev, on test, on acceptance before it goes in production. So we have different SharePoint farms for the different environments. Although the SharePoint folders our always deployed to the same drive, the folder for the tsenu.xml can be different as one of the folders is the GUID of the Search Service Aplication. So I wanted that the timer job would figure out the correct folder using the Search topology.