The concept of treasures in SharePoint world is not new. It was also used in SharePoint 2003. Treasures are like synonym 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 search for word "House", so 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 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 synonymous.
Follow the steps below to configure Treasures in SharePoint 2007:
1. Find the SSP ADMIN Site GUID
- Save the following commands in MS Notepad file as .VBS extension and run. It will display the SSP Admin Site GUID. Make note of GUID Information.
Set objGatherAdmin = WScript.CreateObject("oSearch.GatherMgr.1")
For Each objApplication in objGatherAdmin.GatherApplications
WScript.echo "SSP: " & objApplication.DisplayName & " Application GUID: " & objApplication.Name
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 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 at 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:
o <!---Commented out--->
§ Add the treasures or synonymous 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:
§ <sub> House</sub>
§ <sub> Home</sub>
§ <sub> Apartment</sub>
§ <sub>Flat </sub>
§ 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, following <expansion> tags will generate error:
The value of <Sub> tag must not be repeated in any other <expansion> tag entries. For example, the following statement will also generate error in the event viewer.
§ When you try to open the Tsneu.xml file in Internet Explorer or any other XML Editor, you get the following error:
o Error opening input file: 'tsSchema.xml'. Incorrect definition for the root element in schema. Error processing resource '...
o 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.