Making better use of SharePoint 2013 Search
One of the most interesting sessions about SharePoint was the session from Alan Marshall, OFC218: Making better use of SharePoint 2013 Search. The biggest complaint from users regarding SharePoint Search is: "I can't find anything".
This is not a user's fault, it's just because SharePoint Search is mostly forgotten in SharePoint implementations. "It's an out-of-the-box functionality, right? So we don't need to do anything about it!". That is wrong. Yes, it's available OOTB, but it needs configuration.
Compare this to Google and Bing: They are working with a bunch of people on improving the search experience, every day. The same should happen in any SharePoint platform that is using search, otherwise people won't be able to find what they're looking for.
Query rules and Display Templates
Configuring search is a very broad topic. This session was focusing on query rules and display templates. So, nothing about Content Sources, search ranking, query impact rules, etc., but that was fine. Query rules and display templates are new in SharePoint 2013. Display templates are driven by HTML, so no more XSLT! Yeah!
Query rules
Query rules define the rules that need to be applied to the query entered by the user. Some examples:
- Acting on user intent: If a user enters "My Presentations", by default results are displayed with the text "my presentations". Most likely the user would expect to see only his presentation. This can be achieved using a query rule, this rule detect the word "my", and modify the query such that the final query will be "AUTHOR:current_user presentations".
- User centric rules: Query rules can influence the search results by injecting user's profile details. For example, if a user entered "SharePoint" as it's interest, a query rule can fire when the user searches for "SharePoint" to e.g. display other people with the same interest.
- Apply different templates: It is possible to apply a different template, based on the query or the dataset queried. For example, search results from an external datasource are by default not formatted user friendly. Query rules can be configured for that datasource to apply a different template.
Display templates
Display templates drive the HTML rendering of the refinement panel, search item results and when hovering over search item results. When a display template is saved to SharePoint, a JavaScript file is generated. It is possible to change this JavaScript template if you are a die-hard, but whenever you save the HTML file, your changes are lost. In most scenarios changing the HTML only is sufficient.
Some examples from the presentation:
On the left side, a custom item template is displayed. The default item template is like the results in BING, this is not suitable to display items with custom metadata, like a person details.
On the right side, a custom hover template is showing a map, retrieving its data from the hovered item.
As said, display templates can also be used to customise the refinement panel:
By default, the refinement is text based for most of the fields, a slider is used for a date time field. The default text based template uses counters to display the number of results, using above custom refinement template that can be visualised.
Summary
SharePoint Search is a rich feature, but it needs some attention. It does a great job out-of-the-box, but it definetely needs tweaking and customisation. Query rules and display templates are a powerful way to achieve this, and it's also available to site owners!