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

Posts Tagged ‘configure’

Change Result Page

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

clip_image002

Default Search Results Page

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

clip_image004

How to perform the change?

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

clip_image006

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

clip_image008

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)

clip_image010

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

clip_image012

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

clip_image014

clip_image016

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

Summary

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

Advertisements

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

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.

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

Enable Query Suggestions in SharePoint 2013 Search

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

image

How to configure Query Suggestions?

Open Central Administration > Service Applications > Search Service Application

image

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.

image

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.

image

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

image

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

image

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

image

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.

image

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.

image

References

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

Summary

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 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.

Email

Scenario

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?

Solution

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.

Steps

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.

image

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

image

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.
image

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

image

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

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

image

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:

http://smtp4dev.codeplex.com/

Click the Download button on the appearing page.

image

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

image

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", "to@server.com");

messageHeaders.Add("cc", "cc@server.com");

messageHeaders.Add("from", "from@server.com");

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.

image

References

http://tinyurl.com/sp2010-confemail

Summary

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 »