Navigate Up
Sign In
Supporters of Developer
Web

Build a Search Driven Solution with SharePoint 2013 - Part I

Item is currently unrated. Press SHIFT+ENTER to rate this item.1 star selected. Press SHIFT+ENTER to submit. Press TAB to increase rating. Press SHIFT+ESCAPE to leave rating submit mode.2 stars selected. Press SHIFT+ENTER to submit. Press TAB to increase rating. Press SHIFT+TAB to decrease rating. Press SHIFT+ESCAPE to leave rating submit mode.3 stars selected. Press SHIFT+ENTER to submit. Press TAB to increase rating. Press SHIFT+TAB to decrease rating. Press SHIFT+ESCAPE to leave rating submit mode.4 stars selected. Press SHIFT+ENTER to submit. Press TAB to increase rating. Press SHIFT+TAB to decrease rating. Press SHIFT+ESCAPE to leave rating submit mode.5 stars selected. Press SHIFT+ENTER to submit. Press SHIFT+TAB to decrease rating. Press SHIFT+ESCAPE to leave rating submit mode.

You may also be interested in: SharePoint Conference.ORG 2013

 

Editor's note: Contributor Nicki Borell is a SharePoint Evangelist & Consultant for Experts Inside. Follow him @NickiBorell.

Part I is about Search Driven in on-premise environments

Part II will show the options and differences with O365 SharePoint Online Search Driven Solutions which are not new in SharePoint 2013. But with SP2013 they reached a new dimension and there are many more out-of-the-box web parts and options to work with content that is in your search index.

Admin Stuff

Why would you use Search Driven? Good question. Let’s ask “why not”? The answer is the index latency. Search Driven Solutions are based on the search index and that means that the data freshness depends on the index freshness. With the new feature Continuous Crawling and other solutions like Event Driven Crawling we can come up with a really up to date index. Depending on your environment you can obtain index freshness in the scope of 2 minutes or so. Some other points in the context of Search Driven Solutions are:

  • Separate presentation from storage
  • Flexible and dynamic
  • Breaking down site collection boundaries
  • Eliminate large list thresholds
  • Allows flexible & dynamic publishing

Special Data means Special Search and special Search Results

In some cases we don't have to choose between normal SharePoint Search and Search Result web part or using Search Driven Solutions. There is a very useful and powerful option in between. With SharePoint 2013 there are some new features. In the context of “Special Date means Special Search and special Search Results” we will now have a closer look at “Result Source” and “Query Rules”.

Result Source

Working with search based solutions generally we start with a “Result Source”. Result Sources are places under Site Settings or if you were to configure them for the complete farm in the search service application. A Result Source has some basic parameters:

Protocol: defines from where the results are coming

Type: focused between content and people search

Query Transformation: gives us the option to focus on which data is shown in this Result Source using Search Syntax. Also we have the option of using the Query Builder to define the Query Transformation.

2013-03-19-2013SearchDrivenSolution-01.jpg

To use a Result Source we have to configure the search result web part to use this source. This is simply configured in the settings of the result web part:

2013-03-19-2013SearchDrivenSolution-02.jpg

Query Rules

Query Rules are used to manipulate search query. A Query Rule is always based on a Result Source. That’s why we have to start with a Result Source. Query Rules are also based in the site setting or in search service application. Working with Query Rules we have two main parameters.

  1. Query Condition: this parameter defines under which condition the Query Rules takes effect.

  2. To do this we had several options. The easiest way is “Query matches Keyword exactly”. But we also can use Term store using the option “Query matches Dictionary exactly” This brings many powerful options. For example if you extend your Term set which is referred, you do not need to reconfigure you Query Condition. Also this can be useful in a Multilanguage environment.

  3. Actions: The section configures what should happen if a Query matches.

  4. We can configure a promoted result which is similar to the Best Bets we know from SharePoint 2010 and we can place a Result Block.

Result Blocks are a new feature that allows us to place a separate block containing the data we configured based on our Result Source in the top of the search result web part. Every Result Block can be configured using Query Builder. For example if you use a special Result Block only showing pictures the configuration should be like this one:

  • Query: {subjectTerms} contenttype:image
  • Settings: Item Display Template -> Picture Item

Display Templates are also a new feature in SharePoint 2013. They allow us to use different visualizations based on content type or so. Click here for more details

Here is an example:

2013-03-19-2013SearchDrivenSolution-03.jpg

Bring all this together we can deliver special search for special data.

2013-03-19-2013SearchDrivenSolution-04.jpg

To get a result like this we had to configure a Result Source, based on the Query Rules and then use the Result Source in a search result web part. A detailed step by step walkthrough is shown in the Webcast at the end of the post.

Search Driven Publishing Model

The above solutions are all based on a search query which had to be filled in a search box by a user or had to be configured as a “fixed keyword query” in the settings of the search result web part. Now let’s see how we can create dynamic pages showing content based on Search Querys using the new web part family “Search Driven Content”.

2013-03-19-2013SearchDrivenSolution-05.jpg

As you can see there are preconfigured web parts for different scopes. The context driven web parts like “Popular Items” and “Recommended Items” are based on search analytics, user context and user activity. Other ones like “Pictures” or “Pages” containing a special visualization based on the contented type. The “Search Driven Content” web parts can also be used to visualize search results based on a search query which is typed into a search box. All search web parts can be combined with each other. This is used in configuring the following example:

2013-03-19-2013SearchDrivenSolution-06.jpg

Here you can see the “Search Driven Content” web part for Pictures. In the settings dialog the Display Template is configured to show “Picture on top, 3 lines on bottom”. Under Property Mappings you can choose which Managed Property's are used to fill the lines. In the context of the shown Refiner web part “Refinement Target” is configured to the “Search Driven Content” web part Pictures. The binding is based on the Title of the web part.

Solutions based on the Search API

The Search API allows building Apps or other solutions based on the content coming from the search index. For more information about the SharePoint 2013 Search API look here: LINK

Here is an example based on my demo environment:

http://win-ful28kv4389/_api/search/query?querytext='contenttype%3Aorbeabike'

Using this query the result looks like this:

2013-03-19-2013SearchDrivenSolution-07.jpg

Using this XML we built a demo App showing the same data like in the above shown search result web part using the Result Blocks:

2013-03-19-2013SearchDrivenSolution-08.jpg

Webcast with hands on system demos:

2013-03-19-2013SearchDrivenSolution-09.png

Categories: SPF 2013; Search; dev

Comments

Nicolás

Limit on result blocks?

Hey, Nicki! Do you know if there is any way to show more than 3 result blocks? It seems to be limited to that number for some reason. I've been trying for a while but can't find a solution nor a confirmation that it happens by design. Thanks!

Posted 21-Aug-2013 by Nicolás
Nicolás

Limit on result blocks?

Hey, Nicki! Do you know if there is any way to show more than 3 result blocks? It seems to be limited to that number for some reason. I've been trying for a while but can't find a solution nor a confirmation that it happens by design. Thanks!

Posted 21-Aug-2013 by Nicolás
ar condicionado centro automotivo

Thanks for making such a cool post

Interesting post and thanks for sharing. Some things in here I have not thought about before. Thanks for making such a cool post. - Fazendo ar condicionado automotivo

Posted 28-Oct-2013 by ar condicionado centro automotivo
kathleenedwards

Result blocks

Result blocks are a new function that allows us to position a individual prevent containing the details we developed depending on our Outcome Resource in the top of the google listing web aspect. Every Outcome Block can be developed using Question Builder from a mighty student site

Posted 21-Nov-2013 by kathleenedwards
jeremy williams

Awsome post

First You got a great blog .I will be interested in more similar topics. i see you got really very useful topics , i will be always checking your blog thanks. Web Design Company in Delhi

Posted 07-Apr-2014 by jeremy williams

Notify me of comments to this article

E-mail:
   

Add Comment

Title:

 
Comment:
Email:

   


Name:

 
Url: