Jean Paul's Blog

There are 2 types of People in the World, One who Likes SharePoint and..

    Advertisements
  • Microsoft MVP

  • MindCracker MVP

  • CodeProject MVP

  • eBook on SharePoint 2010

  • eBook on Design Patterns

  • eBook on Windows Azure

  • NLayers Framework @ CodePlex

  • MSDN Forums

  • .Net vs. Java

    Due to Public Demand
  • Advertisements

Thesaurus

Posted by Paul on May 16, 2014


In this article we can explore Thesaurus & its configuration in SharePoint 2013 Search.

What is Thesaurus?

Thesaurus is Synonym which means equivalent words.

image

Why do we need Thesaurus?

Users might find difficulty in typing lengthy search texts like:

1. Human Resource

Instead, they can use pre-configured Thesaurus like:

1. HR

2. HRA

How we specify Thesaurus to SharePoint 2013 Search?

First we need to create a comma-separated Thesaurus CSV file like below.

Key,Synonym,Language

HR,Human Resources,en

HRA,Human Resources

The language parameter is optional.

How to configure Thesaurus?

We need to use PowerShell scripts to configure Thesaurus.

Practical

Let us try to configure Thesauri’s as an exercise.

Step 1: Initial Empty Search

Try searching for HRA and ensure you are receiving no results.

image

This confirms there are no content matching the text HRA.

Step 2: Create Thesaurus file

Create a CSV file with the following content.

Key,Synonym,Language

HR,Human Resources

HRA,Human Resources

Save the file.

Step 3: Install the Thesaurus file

Run the following PowerShell script to install the Thesaurus file.

# Add PowerShell Snapin

if ((Get-PSSnapin “Microsoft.SharePoint.PowerShell” -ErrorAction SilentlyContinue) -eq $null)

{

Add-PSSnapin “Microsoft.SharePoint.PowerShell”

}

$searchApp = Get-SPEnterpriseSearchServiceApplication

Import-SPEnterpriseSearchThesaurus -SearchApplication $searchApp -Filename “\serverc$tempfile.CSV”

The path should be in UNC format. Please change the Server & File names appropriately.

If the installation succeeded, you will get the following message.

image

Step 4: Test the Search

Back in SharePoint; repeat the search using text HRA. You should receive the following results.

image

This confirms successful configuration of Thesaurus. Please note that the results are immediate.

image

Please note that I have configured content sources to www.jeanpaulva.com. This makes the content text Human Resources available.

References

http://technet.microsoft.com/en-us/library/jj219579(v=office.15).aspx

Summary

In this article we have explored Thesaurus configuration.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s