SharePoint 2013 Administration : Enable & Modify Continuous Crawl

SharePoint 2013 includes a new type of crawl by the name Continuous Crawl that ensures the maximum possible refreshness of SharePoint Index.

1

The Continuous Crawl has got the ability to run in parallel and does not expect any previous crawl to get completed before the current one launched.

The Continuous crawl is available only for the SharePoint Index of type SharePoint Sites.

Once started a Continuous Crawl can be Paused or Stopped or Disabled

The default craw interval for Continuous Crawl is 15 minutes but this can be set to any appropriate value.

Since we don’t have any User Interface in SharePoint 2013 to set this value so we are left with only possibility i.e. by using PowerShell.

Enable Continuous Crawl : Central Administration

  • Go to Central Admin and Click on Manage Service Applications

2

  • Click on Search Service Application

3

  • On Search Administration Page click on the Content Sources link on the left navigation

7.png

  • Select SharePoint Index that you want to enable with Continuous Crawl

5

  • On the SharePoint Index Settings Page, scroll down to Crawl Schedule section and select Enable Continuous Crawls radio button and save the settings.

6

Enable Continuous Crawl : PowerShell

$serviceApp = Get-SPEnterpriseSearchServiceApplication

$contentSource = Get-SPEnterpriseSearchCrawlContentSource -SearchApplication $serviceApp -Identity “Local SharePoint sites”

Set-SPEnterpriseSearchCrawlContentSource -Identity $contentSource -EnableContinuousCrawls $True

Modify Default Interval of Continuous Crawl : PowerShell

$serviceApp = Get-SPEnterpriseSearchServiceApplication

$serviceApp.SetProperty(“ContinuousCrawlInterval”, 5)

$serviceApp.Update()

Hope you find it helpful.

Advertisements

SharePoint Developer Tools – Get Your Gears

There are quite a number of Must to Have developer tools that every SharePoint Developer must have in its arsenal in order to boost its own Productivity while developing solutions on SharePoint Platform.

Few of the tools which are my personal favorites also are listed below:

CAML Designer 2013

CAML Designer can generate the CAML Query Stubs based on the inputs provided by the developer and can quickly give a handle on even complex query formations.

It is not just about the Formation of Queries but also offers code Transition from actual CAML Query to

  • Corresponding Server Side Object Model Code
  • Corresponding Managed Client Side Object Model Code
  • Corresponding JSOM & REST API Calls
  • Corresponding PowerShell Code

1

Download Path: http://biwug-web.sharepoint.com/SitePages/Caml_designer.aspx

SharePoint Manager 2013

SharePoint Manager has got quite a simple and intuitive interface which allows you to quickly and easily navigate down the farm and investigate settings, properties, schema XML and so on. Most of the things in your SharePoint environment can be investigated from this tool.

This tool allows you to quickly navigate the Site Hierarchy and objects, and you can also get a quick handle on Schema of List, Fields and on object properties like Object GUIDs, Object Titles and so on.

2

Download Path: http://spm.codeplex.com

ULS Viewer

ULS Viewer allows you to look into the SharePoint ULS Logs in real time by parsing the Logs. The information (Correlation ID, Date Time Stamp, Event Source Process and so on )exposed by this tool is really useful for productive debugging capabilities.

3

With the evolution of SharePoint 2013 Developer Dashboard also includes these capabilities of reading & parsing ULS logs. Developer Dashboard contains a separate tab by the name “ULS” where we can see the ULS log entries.

4

Download Path: http://www.microsoft.com/en-in/download/details.aspx?id=44020

CKS Dev

CSK Dev is a Visual Studio extension which adds a bunch of new Project items for SharePoint Projects that are really helpful in increasing productivity of a developer.

Extension Project Items included

  • WCF Service SPI template
  • Contextual Web Part SPI template
  • Branding SPI Template
  • ASHX SPI template
  • Upgrade Solution Step
  • Restart IIS Step
  • Copy To SharePoint Root Step

And many more…

5

6

Download Path: http://visualstudiogallery.msdn.microsoft.com/cf1225b4-aa83-4282-b4c6-34feec8fc5ec

Color Palette Tool for Branding

Color Palette allows you create a composed looks for SharePoint 2013.

7

Download Path: http://www.microsoft.com/en-us/download/details.aspx?id=38182

SharePoint 2013 Search Tool

SharePoint Search Tool allows to you create and test SharePoint Search Keyword Query backed up by SharePoint REST API paradigm. It also allows you to analyze the Query Stats and adjust them as per the required output.

8

Download Path: http://sp2013searchtool.codeplex.com/

Fiddler

Fiddler is a Web Proxy that allows to Debug Web Traffic, do Performance Testing, HTTP/HTTPs Traffic Recording, Security Testing and so on.

The use of Fiddler becomes utmost necessary now with the evolution of SharePoint 2013 which is more focused on Development Strategies based on Client Side Scripting Technologies.

9

Download Path: http://fiddler2.com/get-fiddler

SPCAF – SharePoint Code Analysis Framework

SharePoint Code Analysis Framework helps to validate your custom SharePoint Solutions and Apps against Best Coding Practices prescribed the industry drawn by various industry standards.

This framework can be really helpful to let you verify if your custom solutions are Stable, Complying with Company Policies, Following Coding Best Practices, Well Designed and Maintainable and much more.

10

Download Path: http://www.spcaf.com

.NET Reflector from Red Gate

.Net Reflector is one of the best tools I have ever used for understanding code of Third Party DLLs for which I even did not had the Source Code.

Reflector allows you to look into the DLLs to see the code encapsulating inside it to understand its functioning.

11

Download Path: http://www.red-gate.com/products/dotnet-development/reflector/

PowerShell Tools for Visual Studio

This is an excellent Visual Studio Extensions for PowerShell which enables code intellisence for PowerShell Scripts within Visual Studio Editor.

12

Download Path: http://visualstudiogallery.msdn.microsoft.com/c9eb3ba8-0c59-4944-9a62-6eee37294597

SPFastDeploy

This tool is specially designed to enhance the productivity while working with SharePoint App.

This tool is best suited for pushing the code changes quickly to SharePoint Apps without re-deploying the Apps. This could save a significant amount of time during App Development.

13

Download Path: http://visualstudiogallery.msdn.microsoft.com/9e03d0f5-f931-4125-a5d1-7c1529554fbd

Advanced REST Client plugin for Google Chrome

This is a Chrome Plugin that allows you configure and investigate REST Queries by configuring and executing REST API Call through the tool UI. It also allows us to look for the Stats of the REST Queries in execution.

14

Download Path: https://chrome.google.com/webstore/detail/advanced-rest-client/hgmloofddffdnphfgcellkdfbfbjeloo?hl=en-US

Postman – REST Client plugin for Google Chrome

This is again a Chrome Plugin that allows you deal with REST Calls same as “Advanced REST Client plugin for Google Chrome”.

It is just a matter of choice which one you prefer to work with.

15

Download Path: https://chrome.google.com/webstore/detail/postman-rest-client/fdmmgilgnpjigdojojpjoooidkmcomcm

SharePoint 2013 Client Browser

This is the similar tool as SharePoint Manager with the only difference that it allows us to connect to SharePoint Sites Remotely using Client APIs. So now no more need to login to SharePoint Server to browser SharePoint Site Objects using this tool.

16

Download Path: https://spcb.codeplex.com/

smtp4dev

This is an awesome tool for testing SharePoint Send Mail Functionalities no matter if it is Custom or OOB functionality that we are testing.

It is used to verify if the SharePoint is sending mails to the recipients properly. This tool intercepts the mails that were sending to the recipients by SharePoint and allows you to view them in its own UI.

17

Download Path: http://smtp4dev.codeplex.com/

PowerGUI

PowerGUI is one of the best tools available for PowerShell Programming. It provides intellisence support for writing PowerShell Scripts at the same time provides lot of useful windows for Debugging purposes.

18

Download Path: http://powergui.org/downloads.jspa

SharePoint Software Factory

The SharePoint Software Factory is a Visual Studio Extension helping SharePoint Beginners, as well as experienced developers to create, manage and deploy SharePoint solutions without having to know schema internals of the SharePoint Artifacts.

19

Following is the list of few of the features offered by this extension-

20

And many more…

For a detailed list of available features you can visit : http://www.matthiaseinig.de/docs/SPSF/OutputHTML/SPSF_RECIPES_INDEX.html

Download Path: https://spsf.codeplex.com/

SharePoint Solution Deployer

SharePoint Solution Deployer helps you to deploy SharePoint solution packages (.wsp) to multiple SharePoint environments. It deploys, retracts and upgrades one or more WSPs and can be extended to perform additional custom tasks in PowerShell before or afterwards.

It provides a simple XML configuration file which allows you to define the deployment environment by using variables i.e. to perform different actions on different URLs depending to which farm you are currently deploying.

21

Download Path: https://spsd.codeplex.com/

SharePoint Diagnostic Studio 2010

Microsoft SharePoint Diagnostic Studio 2010 (SPDiag version 3.0) was created to simplify and standardize troubleshooting of Microsoft SharePoint 2010 Products, and to provide a unified view of collected data.

This tool can be used for-

  • Gathering relevant information from a farm
  • Displaying the results in a meaningful way
  • Identifying performance issues
  • Sharing or exporting the collected data
  • Providing reports for analysis

And much more…

22

Download Path: https://technet.microsoft.com/en-us/library/hh144782(v=office.14).aspx

SPServices

SPServices is a jQuery library which abstracts SharePoint’s Web Services and makes them easier to use. It also includes functions which use the various Web Service operations to provide more useful (and cool) capabilities. It works entirely client side and requires no server install.

23

Download Path: http://spservices.codeplex.com/

SharePoint LogViewer

SharePoint Log Viewer is a Windows application for reading and filtering Microsoft SharePoint ULS Logs.

It offers the following key features-

  • View multiple SharePoint log files at once
  • Search by any field
  • Filter the log by any field
  • File drag & drop support
  • Live monitoring for entire farm
  • Export filtered log entries
  • Bookmark log entries
  • Get popup notification of SharePoint log events from system tray
  • Receive email notifications on errors
  • Redirect log entries to event log
  • Supports SharePoint 2007, 2010 and 2013

24

Download Path: http://sharepointlogviewer.codeplex.com/

FxCop

FxCop is an application that analyzes managed code assemblies (code that targets the .NET Framework common language runtime) and reports information about the assemblies, such as possible design, localization, performance, and security improvements. Many of the issues concern violations of the programming and design rules set forth in the Design Guidelines, which are the Microsoft guidelines for writing robust and easily maintainable code by using the .NET Framework.

25

Download Path: https://msdn.microsoft.com/en-us/library/bb429476(v=vs.80).aspx

JavaScript Beautifier

This online tool is used to beautify, unpack or De-obfuscate JavaScript and HTML, make JSON/JSONP readable, etc.

26

Download Path: http://jsbeautifier.org/

JSON Formatter & Validator

This is an online tool to that can be used to validate the JSON Packets

27

28

Download Path: https://jsonformatter.curiousconcept.com/

Being a SharePoint Developer I can say using these tools should be the second habit for SharePoint Developers to enhance their development capabilities which results in quick delivery turn around.

Hope you all find it helpful.

SharePoint 2013: How to Create Custom Result Blocks using Query Rules

In this article we are going to explore SharePoint Search Custom Result Blocks configured using Query Rules.

What are Results Block?

A Result Block is set of filtered results that are combined with core search results and displayed on top of the core search results as a block or can be ranked with in the Core Search Results depending on how you configure it to be.

It is not required to have results for Result Blocks from Local Search index only. A Result Block can use any of the result source from the below list:

  1. Local SharePoint farm
  2. Remote SharePoint farm
  3. OpenSearch
  4. Exchange

In order to setup this demo, I have prepared the system with some test User Profile data as described below:

I have setup three User Profiles with different job titles as shown below:

User 1 : SP\Administrator

1

User 2 : SP\Guest

2

User 3 : SP\SPDeveloper

3

In order to configure Result Block, we need to start it with Query Rules configuration by using the following steps:

Go To Site Settings

4

Under Search, Click Query Rules

5

Choose Result Source as applicable, here I am working on Local SharePoint Search Results

Click on New Query Rule

6

Under General Information, Enter Rule Name

Under Query Conditions,

  1. Select Query Options as needed, here Advanced Query Text Match works for me
  2. Select phrases which you want to be included while matching query text issued by the user

7

Click on Add Result Block

8

Enter Block Title, this title will be added as Header with the Result Block displayed on Search Result Page.

Click on “Launch Query Builder” Button

Select the number of items to be displayed inside the result block from Items Dropdown as shown below, here I will go with 4 items to be displayed inside Result Block.

9

Configure the Query as shown below:

  1. Select a Result Source to as target for the query, here I am using “Local People Results” as I have setup test data in User Profiles.
  2. Choose suitable property to filter on from Property Filter Drop Down
  3. Choose suitable Operator
  4. Choose suitable value type
  5. Choose suitable value as shown below
  6. Click on Add property Filter
  7. This will add the query filter to the Query Text box
  8. Click on the Test Query Button, to validate the query you have just created
  9. Search Result Preview Section will show few of the total search results returned by the query just configured in the previous steps
  10. Click OK to close Query Builder Dialog

10

Always Choose the setting as shown below, if you want to have Result Block Displayed on top of Core Search Results as a separate block.

You can also choose to display “More” Items link, in case you want to show case the complete result set retuned based on the Query Rule. For this to happen you have to have a separate page configured with the same query to show all the results. I am choosing here not to display it.

11

And That’s it.

We are all done with the configuration work for the result block and now it is time to test the results returned based on the configuration we did above.

Final Configuration would look like as shown below:

12

In order to test the scenario, Enter “MOSS” or “sps” or “wss” as Search Term, remember we added “MOSS, sps, wss”in the search phrases while configuring Query Rules.

Since we got the search term “MOSS” or “sps” or “wss” as a Query issued by user, SharePoint Search System identifies a suitable query rule by matching this term with the phrases we specified while configuring Query Rules above and filter out the results based on the query we specified, in this case it was “JobTitle:SharePoint”, which mean finds any Profiles for which Job Title Property contains the word “SharePoint” .

Based on the query treatment as mentioned above we got two profiles “User 1 : SP\Administrator” with Job Title “SharePoint Administrator” and “User 2 : SP\Guest” with Job Title “SharePoint UI Designer”, displayed as valid results inside Results Block.

On the other hand we do not get “User 3 : SP\SPDeveloper” listed in the Result Block as Job Title Property for this profile is blank, due to this “JobTitle:SharePoint” match gets failed and this result get filtered out as shown below.

13

14

15

Hope this will help someone in need…

SharePoint 2013 : Promoted Search Results

In this post we will explore another cool SharePoint Search Feature commonly known as “Promoted Results”.

Before diving deep into implementation details, let’s have some background on this new cool feature of SharePoint 2013 Search.

What are Promoted Results?

Since the SharePoint 2013 Search System is built up from scratch by absorbing all great features from its predecessors, one of such features is known as “Best Bets” in SharePoint 2010 Enterprise Search, “Visual Best Bets” if we are using Fast Search and now “Promoted Results” in SharePoint 2013 Search Environment.

Promoted Results are triggered by one or the other conditions specified while defining the Promoted Results as we will see next in this post.

In order to define the Promoted Results we will proceed as follows:

Go to “Site Settings -> Query Rules” as shown below:

1

2

On Manage Query Rules Page, Select the appropriate Result Source suited to your needs, then click “New Query Rule” Link as shown below:

3

On the “Add Query Rule” Page

  1. Specify the Rule Name
  2. Specify Query Conditions

Please note the Keyword “SharePoint” that we specified in the below configuration, this will ensure that whenever Search Query contains the Keyword “SharePoint” this Promotion will be served as a part of the search results retuned as a response to this query.

4

Then click on “Add Promoted Results” Link

5

On the “Add Promoted Result” Page,

  1. Specify the Title : Any Valid Title
  2. Specify the URL: Any valid URL of the .aspx Page with valid HTML inside it.

Check the “Render the URL as banner instead of as a hyperlink” checkbox, this will ensure that Promotional Content will be displayed in HTML View instead as a hyperlink.
Click Save to save the changes.

6

Under the “Publishing” Section,

  1. Select “Is Active” Checkbox to enable this Timeline Driven Promotion.
  2. Specify “Start Date” & “End Date” to specify the Timelines for this Promotion to be visible on top of the search results.

7

And that’s it with the Configuration of New “Promoted Result”.

Final configurations would look like as shown below:

8

Now it is the time to Test the “Promoted Result”.

Visit Global Search Center Site and specify the Keyword “SharePoint” as query as shown below.

And sure enough we will get the Promotional Result at the very top of the search results.

9

So we can see how easy is to implement Promoted Results in SharePoint 2013.

Hope this will help someone in need…

SharePoint 2013: How to Develop Custom Content Enrichment Service

In this article we are going to explore one of the Advanced Features of new SharePoint 2013 Search Architecture.

With the evolution of new SharePoint 2013 Search Architecture, SharePoint allows developers to intercept the Content Source Crawl Engine Processing by adding a Custom Step in the Content Processing Mechanism.

If we closely monitor the Content Processing Mechanism, we can identify easily the step where we can hook up the Custom Content Enrichment Service for supporting and extending Content Enrichment process.

1.1

Under the hood, this Custom Content Enrichment Service is implementing an interface “IContentProcessingEnrichmentService”, which is having method that can deal with the incoming Items.

We can utilize Custom Content Enrichment Service in the following scenarios:

  1. If need to push new Managed Properties based on the Content Source being Crawled
  2. If need to push new Managed Properties based on existing Managed Properties associated with the Content Source being Crawled.
  3. If we need to normalize the Managed Properties values when we are dealing with Heterogeneous Content Sources.

So in this walkthrough we will see Scenario 2 where we can push new Managed Properties based on values present in existing properties.

In order to setup the test scenario we need a List with two columns “DemoCompany” and “DemoCompanySymbol” as shown below:

2

Once we got the list ready with columns and data, we have to initiate a full crawl so that the respective Crawled Properties based on these columns are created by the crawling process.

3

4

Now once we are done with setting up the content source, next thing is to create Managed Properties we are going to employ in this demo.

We have two types of Managed Properties which we should consider in this Demo:

  1. Input Properties: These are the Properties which will be supplied to the Custom Content Enrichment Service as Input.

In this case we have DemoCompany, DemoCompanySymbol as Input Properties.

  1. Output Properties: These are the Properties which will be returned back to SharePoint Crawl from Custom Content Enrichment Service after the Properties are nourished with updated data.

In this case we have DemoCompanyWithSymbol as Output Properties.

Only Input properties must be mapped with the respective crawled properties and Output properties must remain unmapped as they will be updated by the Custom Content Enrichment Service.

Also all these properties should be marked as “Queryable”,”Searchable”,” Retrievable” shown below:

5

Also pay attention on the Data Type of these properties, as this information will be needed at the time of retrieving their values in our Custom Content Enrichment Service.

With this we are all done with Content Source Definition, Managed Metadata Properties Configuration.

Now the next thing is to start with the Development of Custom Content Enrichment Service as shown below:

  1. Launch Visual Studio
  2. Create a new Project of type “WCF Service Application”

6

7

Add a reference to “microsoft.office.server.search.contentprocessingenrichment.dll” which can be located at “C:\Program Files\Microsoft Office Servers\15.0\Search\Applications\External”

8

9

10

Add following using statement to your service class:

11

In order to understand the working of this code let’s run Code DNA Test as mention below:

12

  1. Inherit the Service Class with the interface IContentProcessingEnrichmentService
  2. Preparing a variable processedItemHolder of type ProcessedItem to hold the incoming item after processing.
  3. Implement ProcessItem(Item item) Method of IContentProcessingEnrichmentService Interface to deal with incoming Item.
  4. Defining OutPut Managed Property as “DemoCompanyWithSymbol” which we need to create before start writing the code for this service as we have already done above.
  5. Retrieving Input Property DemoCompany, by type casting it as per the Data Type of the Managed Property, like in this case we have a Text type Managed Property so the we are using Type Casting as Property<string>.
  6. Retrieving Input Property DemoCompanySymbol, by type casting it as per the Data Type of the Managed Property, like in this case we have a Text type Managed Property so the we are using Type Casting as Property<string>.
  7. Add the new Property to existing set of properties by using ItemProperties.Add(demoCompanyWithSymbol)
  8. Then finally return the item back to the Crawler for indexing with new set of properties.

In this case we have initialized the “DemoCompanyWithSymbol” Managed Property with the combination of DemoCompany and DemoCompanySymbol properties as

demoCompanyWithSymbol.Value = string.Format(“Company {0} has a symbol {1}.”, companyProperty.Value.First(), symbolProperty.Value);

Once we are done with the code, hit F5 to run the Custom Content Enrichment Service in Debug Mode, so that we can test the logic and debug the issues if we get any.

As soon as you hit F5 you will get a WCF Test Client Application Launches, on this application page copy the URL of the service as shown below:

13

Paste it in the Browser to validate if it is running fine.

14

Ok now when we have got our Custom Content Enrichment Service up and running we can let SharePoint know about this service.

This Service Extension can be registered with SharePoint using PowerShell as shown below:

15

And in case you need to remove this registration later on you can use the following PowerShell command:

19

16

Now once the registration is done, we need to initiate the Full Crawl in order to re-process all the Crawled Items as per the logic written in the Custom Content Enrichment Service.

This is the time when you can put break point in your code and expect it to hit when the Full Crawl sends the first and any subsequent item to Custom Content Enrichment Service for Processing.

At this time you can intercept the code execution to inspect the incoming Items.

17

Once full crawl is done, execute the Search Query directly in browser to see if the new Property DemoCompanyWithSymbol contains the value provided by our Custom Content Enrichment Service.

We can build the search query shown below:

http://<Server Name>/_api/search/query?querytext=’DemoCompanySymbol:DC01110’&selectproperties=’DemoCompany,DemoCompanySymbol,DemoCompanyWithSymbol’&sourceid='<Result Source ID>

Execute the Query and analyze the response to see for DemoCompanyWithSymbol property and sure enough we should get the DemoCompanyWithSymbol property updated with new values as shown below:

18

This implementation could be really effective in cases where we are dealing with Heterogeneous Content Sources or where we are lacking with lesser amount of Metadata information than expected.

Hope this will help someone in need…

SharePoint 2013 : Execute SharePoint Search Queries using CSOM

In this article we will explore the method of executing Search Queries using SharePoint Client Side Object Model. The code sample used in this article can be used in any kind of solution (Farm, Sandbox) or any kind of App (SharePoint Hosted, Cloud Hosted) executing in context of SharePoint.

Prerequisites:

  1. Fiddler Web Proxy should be installed. You can get Fiddler from http://www.telerik.com/download/fiddler

Like in other of the earlier articles we will start with creating new SharePoint Hosted App.

1

The next thing is to provide a simple UI for our implementation which allows the users to specify the Search Terms & execute the queries.

In order to keep the story simple we will take one input box to specify the Search Terms & one button to execute the query as shown below.

2 3

Now once we are done with the UI of the App, the next thing is to prepare a module that will execute the Search Queries and receive the response.

4

Following is the detail inspection of the above code snippet

  1. Initialize SharePoint Context variable (Step 1) then we need to
  2. Initialize the Query Object (Step 2) using the context variable created in Step 1.
  3. Set the Query Text (Step 3). This query text has been specified in the input box by the user executing the query.
  4. Initialize the Search Executor Object (Step 4) using the context variable created in Step 1. This object is solely responsible to execute Search Queries. This object contains a method “executeQuery” which takes query text as its parameter.

Now the next challenge is to identify how to code the next step, as it is dependent on response coming from the SharePoint REST End Point in return of the request executed in Step 4.

So the trick to first reviews the response coming from SharePoint using any Web Proxy. Being a big fan of Fiddler I must insist to make use of it to the purpose.

Below image is showing some sample data present in one of the lists called “Customer”.

5

For the sake of demo let’s pick “ALFKI” as Search Term. On clicking the “Executing Search using CSOM” , the Search Query gets issued to SharePoint End Point and if it is a success we will get the response for sure.

6

If we investigate the response in Fiddler we can see the data structure returned as a part of the response.

7

Based on this observation, we can read the data as shown in Step 5 above.

Once we receive the search results, it is just the matter of choice on how to display it. For the sake of this demo I am just displaying the search results in a div already added to the App UI.

8

And that’s it. We are all done here.

Though the scenario I mentioned here is quite simple, but the presence of Client Side Search APIs in SharePoint 2013 is proved to be very powerful and could be utilized to cater complex business requirements without using any custom code.

Hope this will help someone in need…

 

SharePoint 2013 : How to Create Custom Intent Based Results Blocks Using Query Rules

In this post we will explore a new mechanism of Searching data based on Custom User Intents and serve them as Result Blocks on top of the Search Results.

What is Custom User Intent?

Custom User Intent means matching a Search Term specified by the end user with the Phrases defined using Query Rules. For example, PowerPoint Slides are also known as Decks. So if the business user specified a Search Term as “SharePoint Deck”, it was really intended to search all the PowerPoint Slides which contains “SharePoint” as shown in the image below.

1

Hope the above example suffices to clarify the Custom User Intent.

Business Scenario

For the sake of this demo, I have setup an imaginary scenario, where in my organization business users refer all types of videos as “Small Medium Sized Video” or “SMV”. As the matter of habit all users make use of keyword “SMV” in order to search for video files in SharePoint System.

In order to implement the Custom User Intent based on above scenario we have to follow the below steps:

  • Go To “Site Settings”

2

  • Under “Search” section Click on “Query Rules”

3

  • Create & Configure Query Rule
  1. Select the required “Result Source”, in our case we can go with “Local SharePoint Search Results”.
  2. Click on “New Query Rule” in order to create a new Query Rule.
  3. Specify rule name as “Custom Video Intent”
  4. Under “Query Conditions” “Query Contains Action Term” and specify the phrases you want to match to identify the User Intent, like we specified as “smv;smvs”.
  5. Click on “Add Result Block” to specify the query based on which Result Block will be rendered.

4

5

6

  • Configure Result Block
  1. Specify the “Block Title” as shown below
  2. Click on “Launch Query Builder” button to configure the query

7

  • Configure query
  1. Select result source “Local Video Results”
  2. Click on “Test Query” button to test the query based result source selected in Step 1
  3. “Search Result Preview” Section on the right will show the results returned as a part of the query specified earlier.
  4. Click “OK” to save the Query Changes.

8

  • Configure Display Template

Choose suitable Display Template from “Item Display Template” dropdown list.

9

10

And that’s it. We are all done with our new Query Rule defining Custom User Intent.

 

11

Now it is time to see the Query Rule in Action. In order to test it go to Search Center and enter “SharePoint smv” as search term and click Search Icon. You will see the Search Results Block “Video Results for SharePoint” containing items which contains “SharePoint” in their Title or Description.

12

Hope this will help someone in need…