Posted on:
Categories: SharePoint

Configuring SharePoint 2010 search with a custom thesaurus file allows administrators to manage user search queries in two ways

  1. By using replacement sets to transparently replace user user queries terms with designated alternatives. This is similar to "Did you mean?" functionality without the "Did you mean?" link. The query engine performs the replacement automatically.
  2. By using expansion sets to transparently include common synonyms for search terms. A search query term that has a match in an expansion set will automatically include all other terms in that expansion set.

Put simply, with replacement sets, what is included between PAT tags will be replaced with the term between the associated SUB tag. You can have multiple PAT's per SUB however you cannot have duplicate PAT's in the collection of all replacement sets. Obviously, you can replace a term with only one substitution. You also can not duplicate SUB's in expansion sets across all expansion sets.


Special characters are also to be avoided in all items.

You CAN however, have an identical SUB term in an expansion set that exists as a SUB in a replacement set. Note this will NOT result in a replacement translated into an expansion set. For example; if you have defined the below expansion and replacement sets:


A search for term "pat1" will NOT submit a query for "SUB0","SUB1","SUB2","SUB3". You will only receive results for the term "SUB2".

~~~~~~~~~~~~~~ Materials Required ~~~~~~~~~~~~~~

  • Local administrator permission on SharePoint Query server
  • Replacement and Expansion set terms in properly formed XML file per:
  • Test files with contents of replacement terms, word, powerpoint, excel, pdf

~~~~~~~~~~~~~~ Materials Required ~~~~~~~~~~~~~~

PREP STEPS 1) copy files to target system, include thesaurus, scripts, csv of keywords, test documents Config Steps

  1. Upload query result test files with thesaurus terms to a document library within the configured crawled content source and initiate a full crawl
  2. Perform search with thesaurus synonym and show no TAILORED/BOLDED results
  3. Get access to filesystem of query server [local administrator on server]
  4. Powershell Get-SPsearchService to find path to thesaurus. The GID of the search service will be used to ID the path to the config XML
    • [%ProgramFiles%\Microsoft Office Servers\14.0\Data\Office Server\Applications\GUID-query-0\Config]
    • this may or may not be accurate, we can test by mal forming the tsneu.xml file and restarting search and looking for Event 89
  5. Find "tsneu.xml" and make a backup (copy/paste). Rename backup to "tsneu_OG.xml"
  6. Replace with custom tsneu.xml
  7. Restart SharePoint Search Service [net stop osearch14 , net start osearch14]
  8. Perform search for test terms
    • If error in syntax, should immediately see Event 89 in windows application log indicating :
    • Component: [GUID-query-0]
    • The global thesaurus file C:\Program Files\Microsoft Office Servers\14.0\Data\Office Server\Applications\GUID-query-0\Config\tsneu.xml has a format that is not valid.
    • Edit the file and correct it. Use retail tracing for detailed error description.
    • Once fixed you will need to restart search service again as in #6
  9. Working thesaurus should return validation files, [click view duplicates to see all file results]
    • Validation : Thesaurus translation (input term -> translated search term) will be bolded directly under the URL