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:
Find the SSP ADMIN Site GUID
Locate Tsneu.xml FILE
Update 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
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:
<!--<span class="code-comment">-Commented out---></span>
Re-start the SharePoint Search Service
- 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:
- Save the XML file. Must save the file in Unicode format.
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:
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.
- 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.
Category: Installation and Configuration
Published: 16/03/2009 20:25