Click here to Skip to main content
15,867,453 members
Articles / Web Development / ASP.NET

How to Configure SharePoint Treasure (Synonym) In MOSS 2007

Rate me:
Please Sign up or sign in to vote.
4.33/5 (2 votes)
13 May 2009CPOL4 min read 32.8K   8   2
The concept of treasures in SharePoint world is not new. It was also used in SharePoint 2003. Treasures are like synonyms or similar words that you specify in SharePoint for keywords search.

The concept of treasures in SharePoint world is not new. It was also used in SharePoint 2003. Treasures are like synonyms or similar words that you specify in SharePoint for keywords search.

The thesaurus permits you to type a phrase in a search query and to receive results for words that are related to the phrase that you typed. For example, If user searches for word "House", you also would like to search for "Home", "Flat", "Apartment", etc. The concept of SharePoint Treasures is different than SharePoint Best Bets keywords. In SharePoint Best Bets keyword search, the result returned will be shown in the Best Bets web Part, so Best bets do not influence the ranking of Search Result. The down side in this approach is that you have to manage Best Bets URLs as time goes. So, if you add a new page in the web site and you would like to show this page in the Best Bets Web Part, then you have to manually add this new URL in the Site Collection.

In the case of Treasures, you don't need to make any change in the configuration and new pages will automatically take effect immediately. You have to update the treasures from time to time, if you want to add more synonyms.

Follow the steps below to configure Treasures in SharePoint 2007:

  1. Find the SSP ADMIN Site GUID

    • Save the following commands in Microsoft Notepad file as .VBS extension and run. It will display the SSP Admin Site GUID. Make note of GUID Information.
      C#
      Set objGatherAdmin = WScript.CreateObject("oSearch.GatherMgr.1") 
      For Each objApplication in objGatherAdmin.GatherApplications 
      WScript.echo "SSP: " & objApplication.DisplayName & 
      " Application GUID: " & objApplication.Name Next 
  2. Locate Tsneu.xml FILE

    The thesaurus files contain inactive sample content. The neutral Tsneu.xml thesaurus file is applied to queries that do not have a thesaurus file that is associated with the query language. The neutral thesaurus file is always applied to queries, even when there is a specific thesaurus file that is associated with the query language. So, we will only update the Tsenu.xml file for Treasures to work in SharePoint 2007 environment.

    Thesaurus files for SharePoint Server 2007 are located to the following folder:

    Drive:\Program Files\Microsoft Office Servers\12.0\Data\Applications\[SSP Admin Site GUID]\Config\tsneu.xml

    Note: Always look for the drive where you have configured SharePoint 2007 Indexing. So, if SharePoint 2007 Indexing is configured on S:\Search\ drive, then the complete path will be as follows:

    S:\Search\Program Files\Microsoft Office Servers\12.0\Data\Applications\[SSP Admin Site GUID]\Config\tsneu.xml

  3. Update Tsneu.xml file

    Thesaurus files contain two types of thesaurus entries. These types are replacement sets and expansion sets. Thesaurus files also permit you to configure the word weighting and word stemming options in a replacement set or an expansion set. More details can be found in the Microsoft KB 837847 article.

    • Open the Tsneu.xml file in Notepad.
    • Remove the following comment lines that appear at the beginning and the end of the file:
    <!---Commented out---> 
    • Add the treasures or synonym inside an <expansion> tag. In the expansion tag, you specify one or more substitutions that are enclosed by a <sub> tag. For the example that is described earlier, add the following lines:
      • <expansion>
      • <sub> House</sub>
      • <sub> Home</sub>
      • <sub> Apartment</sub>
      • <sub>Flat </sub>
      • <expansion>
      • Save the XML file. Must save the file in Unicode format.

  4. Re-start the SharePoint Search Service

    Run the following command on command line:

      • NET Stop oSearch
      • NET Start oSearch

Things to Remember

You do not need to run Full Crawl or do IISRESET or Reset the Index in order for Treasure to work.

Expansion Tag in the Tsneu.XML must not be repeated. Treasures will stop working immediately. An error is also logged in the Event Viewer.

For example, the following <expansion> tags will generate an error:

XML
<expansion> 
<sub>Allowance</sub> 
<sub>Increase</sub> 
</expansion> 
<expansion> 
<sub>Income</sub> 
<sub>Profit</sub> 
</expansion> 
<expansion> 
<sub>Allowance</sub> 
<sub>Increase</sub> 
</expansion> 
<expansion> 
<sub>Guarantee</sub> 
<sub> Agreement</sub> 
</expansion> 

The value of <Sub> tag must not be repeated in any other <expansion> tag entries. For example, the following statement will also generate an error in the event viewer.

XML
<expansion>
<sub>Allowance</sub>
<sub>Increase</sub>
</expansion>
<expansion>
<sub>Asset Register</sub>
<sub>Allowance</sub>
<sub>Assets Register</sub>
</expansion> 
  • When you try to open the Tsneu.xml file in Internet Explorer or any other XML Editor, you get the following error:
    • Error opening input file: 'tsSchema.xml'. Incorrect definition for the root element in schema. Error processing resource '...
    • Ignore this error as this XML validation will not affect treasure to work properly.
  • When you open the txneu.xml in Notepad, make sure to save this file as Unicode.

Important Resources

Category: Installation and Configuration
Published: 16/03/2009 20:25

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
Architect Version 1
Ireland Ireland
Adnan Ahmed is SharePoint Architect in Version 1(http://www.version1.com), the IT Consulting Company in Ireland and has involved with many large enterprises to help them realise real benefits of SharePoint 2007|2010.

SharePoint Architect | Blogger | IT Evangelist | MCPD SharePoint 2010 Developer| MCITP SharePoint Administrator 2010

Email: adnan.ahmed@live.ie
Owner: http://www.mossgurus.com
http://www.sp-blogs.com
Linked In Profile: http://www.linkedin.com/in/syedadnanahmed

My Blogs:
http://www.sp-blogs.com/blogs/adnan

Comments and Discussions

 
QuestionSynonymous or Synonyms? Pin
Dougals Jensen12-May-09 13:14
Dougals Jensen12-May-09 13:14 
AnswerRe: Synonymous or Synonyms? Pin
Syed Adnan Ahmed13-May-09 11:09
Syed Adnan Ahmed13-May-09 11:09 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.