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 ‘search’

SharePoint Server 2013 Search Features

Posted by Paul on April 14, 2015

In this post we can quickly explore the SharePoint 2013 Search features for the Server edition.

Search by Metadata

Additional to Search by Content, SharePoint provides search on Enterprise keywords & Managed Metadata

Refiners

Search Refiners provides quick filtering of search results using common properties. Search Refiners are displayed in the left pane of the search results page.

Query Suggestions

This feature provides automatic suggestions based on the query string.

Promoted Results

Search Administrator can promote results based on keywords.

KQL

Keyword Query Language provides advanced syntax & filtering for query construction.

Search Scopes

Search Scopes allows limiting the search content boundary within a site or site collection.

Search Verticals

Allows filtering of search results by:

1. Everything

2. People

3. Conversations

4. Videos

We can also create custom search verticals.

Result Sources

Result Sources allow to configure external content sources like another SharePoint site, External web site, Federated Bing search etc.

Document Preview

Document Preview allows previewing of Office documents within the search results.

Continuous Crawl

Continuous Crawl enables fresh content to appear in search results.

Display Templates

Allows custom formatting of search results.

Summary

In this article we have explored the Search features in SharePoint 2013 Server edition. I believe this will be serve as a quick-reference in SharePoint world.

Advertisements

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

Content Enrichment Web Service

Posted by Paul on May 21, 2014

In this article we can explore an Advanced Search feature of SharePoint 2013.

What is Content Enrichment Web Service?

SharePoint 2013 allows developers to add a custom step between content processing. SharePoint while content source crawl will call our custom web service. We can create or change the metadata properties associated with the crawl item.

Under the hood, the web service is actually implementing a pre-defined interface. Each crawl item will be passed to the interface method where item URL & properties can be accessed.

Scenarios

We can use Content Enrichment Web Service for the following scenarios:

1. You have multiple web content sources configured. You need to create new Managed Properties based on each URL. Example: Blog, Website etc.

2. You have a content source with limited metadata information. You need to add new Managed Properties based on the content.

3. You have a content source with metadata information. You need to correct the Managed Properties.

4. You have a SharePoint list where Age column exists. You need to classify the content as Minor & Major using Managed Properties.

Infrastructure

Following are the Infrastructure need:

1. Visual Studio 2012

2. IIS website to host the service

3. WCF service

Practical

To perform the Practical, we need to setup the following.

1. SharePoint 2013 Enterprise site

2. Create Enterprise Search Center site

3. Central Administration > Search > Create Content Source > Add www.jeanpaulva.com

4. Central Administration > Search > Create Content Source > Add www.sharepointcto.com

5. Central Administration > Create Crawl Rules > Include query strings (?) for both URLs

6. Server > IE Enhanced Security Configuration > Off

7. Perform Full Crawl for both content sources

After the above steps, Try searching for sharepointcto from the Enterprise Search Center site & you should be able to see results from both the URLs as shown below.

image

Our aim is to provide refiners like below.

image

Steps

Step 1: Create Service

Create a new WCF service application project.

image

Delete the existing Service files & create a new Service.

image

You can delete the interface file as well. The Solution Explorer looks like below.

image

Add Reference to the following assembly:

· 15HIVESearchApplicationsExternalMicrosoft.Office.Server.Search.ContentProcessingEnrichment.dll

Step 2: Implement Interface

Open the SVC file & implement pre-defined interface IContentProcessingEnrichmentService as shown below.

image

The only method named ProcessItem passes an Item argument and returns ProcessedItem argument.

The interface IContentProcessingEnrichmentService belongs to the ContentProcessingEnrichment assembly.

The Item type has a property named ItemProperties which contains pre-defined Name-Value pairs of:

ContentType

Access the Content Type of the item

Name

Access the Name of the item

Title

Access the Title of the item

Path

Access the Path of the item

ContentSource

Access the ContentSource name

We can specify the input & output properties while registering the service. In our case we are using the Path property.

Step 3: Create Method

Replace the method with the following code. Right click & Resolve type name errors.

public ProcessedItem ProcessItem(Item item)

{

ProcessedItem processedItem = new ProcessedItem();

processedItem.ItemProperties = new List<AbstractProperty>();

var p = item.ItemProperties.Where(n => n.Name == “Path”).First();

string url = p.ObjectValue.ToString();

if (!string.IsNullOrEmpty(url))

if (url.StartsWith(“http://www.sharepointcto.com&#8221;))

{

Property<string> property = new Property<string>()

{

Name = “WebType”,

Value = “Site”

};

processedItem.ItemProperties.Add(property);

}

else if (url.StartsWith(“http://www.jeanpaulva.com&#8221;))

{

Property<string> property = new Property<string>()

{

Name = “WebType”,

Value = “Blog”

};

processedItem.ItemProperties.Add(property);

}

return processedItem;

}

The above code performs the following:

1. Get the Path property value

2. If Path value is of www.sharepointcto.com then creates a Managed Property WebType and set value to Site

3. If Path value is of www.jeanpaulva.com then creates a Managed Property WebType and set value to Blog

4. The processedItem object will be returned by method

Step 5: Run the Service

Save & Run the Service.

image

Step 6: Create Managed Property

Open Central Administration > Service Applications > Search Service Application > Search Schema > New Managed Property page. Enter the following details.

image

· Name as WebType

· Type as Text

· Searchable enable

· Queryable enable

· Refinable yes-active

Step 7: Register Service using PowerShell

Open PowerShell ISE editor & Paste the following code.

# Add PowerShell Snapin

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

{

Add-PSSnapin “Microsoft.SharePoint.PowerShell”

}

# Get SearchServiceApplication

$ssa = Get-SPEnterpriseSearchServiceApplication

Remove-SPEnterpriseSearchContentEnrichmentConfiguration –SearchApplication $ssa

$c = New-SPEnterpriseSearchContentEnrichmentConfiguration

$c.Endpoint = “http://localhost:52156/WebsiteEnrichmentService.svc&#8221;

$c.DebugMode = $false

$c.SendRawData = $false

$c.InputProperties = “Path”

$c.OutputProperties = “WebType”

Set-SPEnterpriseSearchContentEnrichmentConfiguration –SearchApplication $ssa –ContentEnrichmentConfiguration $c

Please remember to use the correct URL for the service.

Save & Run. If no errors, your service is installed successfully.

Step 8: Perform Full Crawl

Open Central Administration & Perform Full Crawl for the following content sources.

1. Web content source for www.sharepointcto.com

2. Web content source for www.jeanpaulva.com

Step 9: Add Refiners to Result Page

Open the Enterprise Search Center result page, bring the page to edit mode, edit the refiner web part & add the WebType refiner. You can view References section on how to add Search Refiners.

Step 10: Test Search

Open the Enterprise Search Center Site & Try searching for content. You can see the Web Type refiner appearing & try clicking on the values.

image

If the result is filtered based on Blog or Site values, it means the Refiners are working correctly.


As the Content Enrichment Web Service will be called for all the Content Sources, Performance can become sluggish as there is a delay involved in the service invocation. It is recommended that we should deploy the service closer to the SharePoint system. Alternatively, one can try Asynchronous mode too.

We can also debug the service. Ensure the Service is running & set breakpoints.

image

References

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

http://www.jeanpaulva.com/index.php/2014/04/20/search-refiners/

Summary

In this article we have explored Content Enrichment Web Service. The source code & script is attached along with for download.

Posted in 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 »

Clear Crawl Contents

Posted by Paul on May 12, 2014

In this article we can explore how to clear the crawled contents.

When we need to Clear Contents?

We need to clear contents on:

  1. Starting a new search content index store
  2. Remove unwanted or obsolete search content

How to perform Clear?

We can use the Central administration > Reset Index page to perform the same.

Steps

Following are the steps involved.

Open Central Administration > Manage service applications

image

Click on the Search Service Application

image

Click on the Index Reset link

image

In the appearing page choose Reset Now button

image

There you are! The index database is cleared.

Confirmation

You won’t get any results while you search.

image

Summary

In this post we have explored how to clear the indexed search contents.

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

Configure Bing Search

Posted by Paul on May 7, 2014

In this article we can explore how to configure Bing Search in SharePoint.

What is Bing Search?

Bing Search in SharePoint allows searching in www.bing.com within SharePoint.

1. It requires Enterprise edition of SharePoint to configure this

What is the Advantage?

Users can use SharePoint as a Central Page to search multiple search engines.

How Bing Search is achieved?

We are using Federated Search to achieve this. Here the user search term is passed to Bing.com through Open Search protocol.

image

There are 2 types of Search in SharePoint. One is Indexed Search where the SharePoint Crawler periodically collects data of external systems & indexes them in SharePoint database.

The other one is Federated Search which can be used for systems where Indexing is not possible / time consuming / resource centric / result freshness required. In Federated Search, the user search term is passed to the third party search provider using Query strings & the result can be retrieved as RSS and will be formatted and displayed in SharePoint.

Steps

Following are the steps involved.

Step 1 Create Result Source

Open Central Administration > Manage service applications > Search Service Application > Result Sources page

image

Choose the New Result Source option.

Enter the following information:

1. Name Bing

2. Protocol Open Search

3. Search Term (no change)

4. Source Url http://www.bing.com/search?q={?searchterms}&format=rss

Save changes.

image

The query string q={?searchterms} passes the user-typed term in SharePoint to the Bing URL.

The query string format=rss emphasizes returning results as RSS feeds without the Bing HTML content.

image

Result sources limit searches to certain content or to a subset of search results. You can also use result sources to send queries to external providers such as Bing.

Step 2 Modify Search Result Page

Now we need to associate the Bing result source to a result page.

Create an Enterprise Search Center template & Open the result page.

image

Choose Page Settings > Edit Page & then Edit Search Results web part.

image

Choose the Change Query option.

image

Select the result source as Bing (our new result source)

image

Save changes to dialog, web part & page.

Check-in & Publish the page.

Step 3 Test Search

Now we are ready to test the search. Open the Enterprise Search Center site and run a query. You should be able to see results from bing.com.

image

This concludes our Federates Search using Bing.

image

In the example we have modified the default search result page of enterprise search center site. You may wish to revert the changes or delete & create another site.

image

Please note that Federated Search is possible only if the Provider enables OpenSearch compliant RSS feeds. You can see this in the provider site as shown below for Bing Search.

image

References

http://msdn.microsoft.com/en-us/library/office/cc806030(v=office.14).aspx

Summary

In this article we have explored how to configure Bing Search in SharePoint.

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

Search Error: The content for this address was excluded by the crawler because this item was marked with a no-index meta-tag. To index this item, remove the meta-tag and recrawl.

Posted by Paul on April 29, 2014

While indexing a SharePoint site, I encountered the following error:

The content for this address was excluded by the crawler because this item was marked with a no-index meta-tag. To index this item, remove the meta-tag and recrawl.

Solution

If the mentioned URL is a Document Library > Change > Advanced Settings >

Allow items from this document library to appear in search results > To Yes

image

If the mentioned URL is a Site > Change > Site Settings > Search and Offline Availability >

Allow this site to appear in search results? > To Yes

image

After making the changes, Go to Central Administration > Service Applications > Search Service Application > Content Sources > Start Full Crawl

Problem Solved!

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

Search Configuration

Posted by Paul on April 13, 2014

In this article we can explore the underlying Configurations required to enable Search in SharePoint 2013.

Search Service Application

Search Service Application needed to be created for working with SharePoint Search. This service application enables all the search components & provides interface to manage them.

The underlying infrastructure includes:

· Content Sources

· Result Sources

· Result Types

· Crawler

· Indexer

· Schema

By default, Search Service Application is created while installing SharePoint.

How to create Search Service Application?

Open Central Administration > Manage service applications link.

image

In the appearing page you can see the Search Service Application listed.

image

If you cannot see one, choose the New button from the ribbon, then Search Service Application item.

image

In the appearing page enter the application information:

· Name

· Application Pool

· Account

image

Click the Ok button to save changes. Wait for few minutes & your Search Application Service will get created.

image

You can click on the Search Service Application to view the Search Topology.

image

It is recommended to use a Managed Account for search.

Search Accounts

We can specify the user accounts who can manage the service application.

Service Applications page > Click on the Search Service Application (non-text area) > Click Administrators button from the ribbon.

In the appearing page enter the Administrator account; Click Add button & give check the Permission items as shown below.

image

Click OK button to save changes.

Search Components

Following are the core Search Components:

· Crawler

· Indexer

· Query Processor

Crawler is responsible for reading all the contents (documents, lists, items etc.)

Indexer maintains an index to the crawled contents

Query Processor handles user queries. For example when user searches for Home the query processor handles it.

Analyzer carries out search usage analysis.

Types of Crawling

There are 3 types of Crawling:

· Full Crawl where the entire content will be crawled. This is time consuming & usually takes 30 minutes for a 1 GB of content. (no 2 crawls can be in parallel)

· Incremental Crawl only crawl content modified since last crawl. (no 2 crawls can be in parallel)

· Continuous Crawl can be configured to start at regular intervals & multiple crawling can happen. Thus continuous crawl provides fresh results compared with others.

image

image

Despite availability of incremental & continuous crawls, a Full Crawl might be required during service updates, new content source addition, managed properties extraction etc.

Content Sources

By default there will be a content source named Local SharePoint sites. We can also configure other content sources like:

· Another SharePoint site

· External website

We need to perform a Full Crawl to do our search.

Full Crawl

To perform a Full Crawl open Central Administration > Service Applications > Search Service Application > Content Sources link.

image

In the appearing page click the context menu over default content source & choose Start Full Crawl option.

image

Wait for few minutes until the Crawl is completed. You can refresh the page often to see the status.

Testing Search

After the Full Crawl is completed you can go back to the SharePoint Site and search for Home. If your site title matches the word, you will get results like below.

image

The result confirms the Search is configured correctly.

References

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

Summary

In this article we have explored the Configuration required to enable Search in SharePoint 2013.

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

Search Alerts

Posted by Paul on July 24, 2012

In this article we can examine the Search Alerts feature of SharePoint.

What is Search Alert?

Search Alert is a feature by which the user query is saved. Later when a content matches the query, the user is informed about the content through email or RSS feed. The major search providers online have this feature.

SharePoint 2010 also provides the Search Alert feature.

Experimenting with Alert

You can try with the Search Alert feature.

1. Open the default site and use the search term which does not exist. For eg: Art of Living. Clearly your search result will be none as shown below.

clip_image002

2. Now click on the Email button which is highlighted above. You will get the following screen

clip_image004

Enter the details and click the OK button. Your Search Alert is ready.

For testing the alert, create a list content with the Alert Keyword. You will be getting email notification for the same as daily summary / weekly summary based on the option you have selected. We can also add RSS feeds as an alternative for Email.

References

http://www.bainsight.com/blog-archive/Pages/5-12-2011.aspx

Summary

In this article we have explored the Search Alerts feature of SharePoint.

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

Manage Search Scope

Posted by Paul on June 29, 2012

In this article we can experiment with managing search scope.

Search Scope allows the user to search within a particular scope. By default SharePoint provides entire site collection search. If the user knows the search item is within a file system, he/she can specify the scope to narrow the search results. This will allows in faster locating of the context item.

The default search scope is All Sites.

Adding a new Search Scope

1. Open SharePoint Central Administration > Manage Service Applications > Search Service Application page

image

2. Click on the Scopes link as highlighted above

image

3. Click on the New Scope link from the appearing page. Enter the details as shown below and click the OK button.

image

4. Click the Add rules for our newly created scope as shown below

image

5. Set the properties as shown below (Pointing to our File System Content Source)

image

Click the OK button to continue. Now we are ready with a Scope set with rules. But in order to view the scope in Search drop down list, we need to do the following steps.

6. Click Search Administration > Start Updating Now link as shown below

image

7. Now open our default SharePoint site and open the Site Settings > Search scopes

image

8. Click the Display Groups button from the top bar as shown below

image

9. Select the Edit Display Group option as shown below.

image

10. Select the File System Scope and click the OK button

image

Now the Search Scope is ready within our site. You can experiment it by opening a site and selecting the scope from the scope drop down list.

image

References

http://office.microsoft.com/en-us/sharepoint-server-help/managing-search-scopes-HA001160438.aspx

Summary

In this article we can experimented the manage search scope feature of SharePoint. In the real world scenario Administrators need to configure different search scopes for different site collections.

Posted in C# | Tagged: , | Leave a Comment »