Jean Paul's Blog

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

  • 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

Posts Tagged ‘configure’

Change Result Page

Posted by Jean Paul on May 22, 2014

In this article we can explore how to change the default search result page in SharePoint 2013.

Why we need to change the result page?

After creating Search Center site, there are 2 options for the user:

1. Use the default search box which takes to the default result page

2. Use the search center site for searching

The preferred approach is to change the default result page once the search center site is created.

Default Search Results Page

Following is the snap of the default search results page. The path would be _layouts/15/osssearchresults.aspx.


Default Search Results Page

Following is the snap of the enterprise search results page. The path would be searchcenter/pages/results.aspx


How to perform the change?

Open Site Actions > Site Settings page from the root site.


Click on the Search Settings link from the page. You will get the following page.


You can make the following changes:

1. Enter Search Center URL (for example /YourSearchCenterSite)

2. Uncheck Use the same results pageoption

3. Enter Result Page URL (for example /YourSearchCenterSite/results.aspx)

Click OK to save changes.

(my search center URLs looks like below)


After saving, you can Test the changes. Open the root site & search using the default search box.


You should see the results are shown in the Enterprise Search Center results page.



Please note that you need to create an Enterprise Search Center site before attempting this step.


In this article we have learned how to change the default search results page.

Posted in SharePoint, SharePoint 2013 | Tagged: , , | Leave a Comment »


Posted by Jean 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.


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.


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.


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.


This confirms there are no content matching the text HRA.

Step 2: Create Thesaurus file

Create a CSV file with the following content.


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.


Step 4: Test the Search

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


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


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



In this article we have explored Thesaurus configuration.

Posted in SharePoint, SharePoint 2013 | Tagged: , , , , , | Leave a Comment »

Enable Query Suggestions in SharePoint 2013 Search

Posted by Jean Paul on April 3, 2014

In this article we can explore how to enable Query Suggestions in SharePoint 2013 Search.

What are Query Suggestions?

Query Suggestions are auto complete items dynamically displayed in the Search text box.  This helps the user from typing the complete text as well as find out relevant search phrases.  Usually, Query Suggestions are based on past phrases history but we can also configure Query Suggestions.


How to configure Query Suggestions?

Open Central Administration > Service Applications > Search Service Application


From the left hand side choose the Query Suggestions link.  You will get the following page.

Enable the Show check box and choose the Import from text file option.


You can create your own phrases text file based on the customer requirement. 

I am using a sample text file which provides phrases for California state.


Save the text file & assign it to the import area.


After importing click save settings in the Query Suggestions page.

Now we have set the phrases to Search Service > Query Suggestions.

Run Timer Job

The phrases need to be returned to the Search User Interface by running the following timer job. 

Open Central Administration > Monitoring > Job Definitions > Go to Page 2 > Prepare Query Suggestions


Click on the item and you will get the following page.


You can see that the timer is set for daily execution, but we need to choose Run Now option to get immediate results.

You can optionally use an IISRESET too.

Testing the Query

Open your SharePoint site & type California in the text box. Wati for 3-5 seconds & you should see the auto-suggestions listed.


This confirms the Query Suggestions configuration.

Connecting Query Suggestions with Promoted Results

In real-world scenarios you can connect Promoted Results key words to Query Suggestions.  This will give more assistance & relevant results to the users.

Excluding Phrases

You can also exclude phrases from the Query Suggestions page.




In this article we have explored what is Query Suggestion & How to configure it.  I hope you enjoyed the piece of knowledge.

Posted in SharePoint, SharePoint 2013 | Tagged: , , | Leave a Comment »

Configuring Email for Development Server

Posted by Jean Paul on October 14, 2012

In this article we can explore how to configure Email for Development Server. In real world development scenarios you need to work with Email enabled lists / workflows / code.



Your customer reported a problem with Email sending from a web part you have developed. You need to ensure the piece of code works fine in your development machine. As there is no email server configured in your machine – How to test this code?


We can set up a Development Server with emailing enabled. Setting up Email for the Development Server along with a Receiver tool you can ensure that emailing code is working perfect.


Following are the steps involved:

1. Configure outgoing SMTP server

2. Set Email property for User Profiles

3. Install smtp4dev tool

4. Test Email Code

Please note that I am using a Windows 7 64-bit machine for working with this. The same configurations should work for Windows Server development machine.

Configure outgoing SMTP server

Open Central Administration and click on the System Settings category from the left.


In the appearing page click on the Configure outgoing e-mail settings link highlighted above. You should get the page given below.


Enter the Outbound SMTP server as your machine name. Please enter a name instead of IP Address or localhost.

Enter the From and Reply-To address.

Click the OK button to save the changes.

Set Email property for User Profiles

As the next step we need to set the user profile property E-mail for testing the feature. You can set this through:

1. My Profile of each user

2. Central Administration for all users

Let us use the Central Administration way as we can set for multiple users. Open Central Administration > Manage service applications > Select User Profile Service Application > Click Manage button from toolbar.

In the appearing page click on the Manage User Profiles link as highlighted below:


In the appearing page search for user and from the result choose Edit menu item.

In the Edit profile page set the Work-email property and save changes.


Install smtp4dev tool

Now we can try installing the smtp4dev tool (a wonderful tool) that captures the Port 25 of your machine. You can download the tool from following location:

Click the Download button on the appearing page.


Run the downloaded file and you should see the following screen.


By default the tool started to listen on Port 25. You can minimize the tool and it is available in the system tray.

Note Running another instance of the smtp4dev tool cannot listen to the same port 25. You need to invoke the previous copy of the tool from system tray to view any email messages.

Test Email Code

Now we are ready to test the email code. Start a new SharePoint Console application, change the project properties to .Net Framework 3.5 and replace the Program class content with following code.

using System.Collections.Specialized;

class Program


static void Main(string[] args)


using (SPSite site = new SPSite("http://localhost"))


StringDictionary messageHeaders = new StringDictionary();

messageHeaders.Add("to", "");

messageHeaders.Add("cc", "");

messageHeaders.Add("from", "");

messageHeaders.Add("subject", "Email Subject");

messageHeaders.Add("content-type", "text/html");

SPUtility.SendEmail(site.OpenWeb(), messageHeaders, "Email Body");




For the time being we are using dummy email address. Try executing the code. You can see the email being captured by smtp4dev tool.




In this article we have explored how to configure email server for a development machine and use smtp4dev tool to capture the emails generated from the machine. You can use the same configuration to test other emails through Workflows, Web Parts etc. that are generated through SharePoint.

Please note that here we are setting up a development machine email server and for configuring the actual email service you need to check the link from References section.

Posted in SharePoint | Tagged: , , , , , , | 6 Comments »