More Related Content Similar to March spug (20) March spug1. SPUG: SHAREPOINT 2013 SEARCH
Sub-Title: Customizing Search to Meet Your Company’s Needs
Author: Dan Adams
Date: March 3rd, 2015
2. Copyright © 2013 Rightpoint | Proprietary and Confidential 2
AGENDA
1 Let Me Introduce Myself
2 The Rules (yes there are rules!)
3 My Favorite SharePoint 2013 Search Features
4 Common Search Myths
5 Enough Talk…. Lets Build This Thing
4. Copyright © 2013 Rightpoint | Proprietary and Confidential 4
INTRODUCTION – WHO IS THIS GUY?
• Name: Dan Adams
– Contact Info: dadams@rightpoint.com
– LinkedIn: https://www.linkedin.com/pub/dan-adams/50/876/108
• Profession: SharePoint Consultant
• Versions: SharePoint 2003, 2007,
2010, & 2013
• Personal Hobbies:
– Skateboarding
– Tinkering With SharePoint
– JavaScript
– Video Games
6. Copyright © 2013 Rightpoint | Proprietary and Confidential 6
THE RULES FOR TODAY’S SESSION
• It is after 6 and we’re all here
voluntarily, so lets have some fun
• There is plenty of pizza & soda so
feel free to grab some!
• If you have a question on anything
that I am running through, please feel
free to throw up a hand or call out
• If the question is too specific or
involved, I may ask that we sidebar it
and discuss it after the presentation
8. Copyright © 2013 Rightpoint | Proprietary and Confidential 8
MY FAVORITE SHAREPOINT 2013 SEARCH FEATURES
• Content By Search
– Who misses Content Query?
• Hover Panels
– Utilizes Office Web Apps to preview
Office Documents without having to
open them on hover
• Continuous Crawls
– No need for a incremental schedule
– Maximum search index freshness
– Default every 15 minutes
• Result Sources
– “It’s my content and I want it now!”
– Queries which can be applied to Search
Web Parts to obtain the information you
desire
• Term Driven Pages
– “One Page To Rule Them All”
– Re-use & maintain one page to surface
content
• Works Across Site Collections!
9. Copyright © 2013 Rightpoint | Proprietary and Confidential 9
MY FAVORITE SEARCH FEATURES… CONTINUED
• Visual Refiners
– Everyone loves graphs (especially
Execs), so who wouldn’t love filtering by
them?
• Display Templates
– Control how your results look and act,
with well known web technologies
– No More XLST!
• Managed Properties Automatically
Created With Site Columns
10. HOW ARE YOU USING SEARCH?
Are you utilizing Search?
11. Copyright © 2013 Rightpoint | Proprietary and Confidential 11
COMMON SEARCH MYTHS
• “We already have a search center ,
I missed the boat!”
– You don’t have to use your global search
center if one already exists, you can
make your own!
• “My Result Source query isn’t
working, I must be doing something
wrong.”
– The query builder is great, but there are
a few places that it straight out lies!
• A user has to put in some sort of
search term in order to use Search
– Although we can include a user’s input,
we don’t necessarily need it
– Think of search as a reservoir of
captured information that you can bend
to your will!
12. Copyright © 2013 Rightpoint | Proprietary and Confidential 12
ENOUGH TALK… SEARCH CENTER PREREQUISITES
• Enterprise Search Site Prerequisites
– Site Collection: Publishing Feature must
be turned on
– Site Collection: SharePoint Server
Standard Site Collection Features must
be activated
13. Copyright © 2013 Rightpoint | Proprietary and Confidential 13
NOW THAT WERE SET UP FOR SUCCESS LETS…
• Create the search sub site
• Walkthrough the structure of a
Enterprise Search Site
• Route our search queries to the
newly created site
• Discuss Managed Properties vs
Crawled Properties & where to find
them
• Create a new Result Source
• Create a new Search Vertical
• Apply the new Result Source
• Add totals to our refiners
• Add a new Date Slider Refiner
• Dive into a display template!
There are so many bullet
points!!!!
(Don’t worry it’s scarier
than it sounds)
14. Copyright © 2013 Rightpoint | Proprietary and Confidential 14
HOW IS SEARCH STRUCTURED
Control Template
Item Template
Search Vertical
Refinement
Panel
15. Copyright © 2013 Rightpoint | Proprietary and Confidential 15
LETS ROUTE SEARCH QUERIES TO OUR NEW SITE
16. Copyright © 2013 Rightpoint | Proprietary and Confidential 16
MANAGED PROPERTIES VS CRAWLED PROPERTIES
• Display Templates & Result Sources
use managed properties
• They have many configuration
options (we will take a look in a sec)
• Many crawled properties can be
mapped to a single Managed
Property
• In 2013 site columns will
automatically create an associated
managed property
How about an example?
Family
Brother Mom Dad
Author
CreatedBy DocumentAuthor MailTo
17. Copyright © 2013 Rightpoint | Proprietary and Confidential 17
RESULT SOURCES
• Result Sources are applied to search
web parts in order to tell it what you
would like returned.
• Result Sources are responsible for
what content to return, how to sort it,
and the ranking model
• Some Resources To Reference:
– Variables / Tokens which can be used:
https://technet.microsoft.com/en-
us/library/jj683123.aspx
• “Hey Dan, you mentioned that the
query builder lies, can we see a few
examples?”
18. Copyright © 2013 Rightpoint | Proprietary and Confidential 18
SOME EXAMPLES WHERE THE QUERY BUILDER FALLS DOWN
The example below was created by
using the Query Builder GUI to try and
only return content where the content
type display name equals
announcement
• Wrong - Provided By Query Builder
– ContentType=0x0104*
• Correct Syntax
– SPContentType="Announcement"
The example below was created by
using the Query Builder GUI to try and
only return content where the content
type ID equals SportingEvent
• Wrong - Provided By Query Builder
– ContentTypeId=0x01010200FA9874CAB
D1D2D47B1F3886B6DE16BCC*)
• Correct Syntax
– ContentTypeId:0x01010200FA9874CAB
D1D2D47B1F3886B6DE16BCC*
19. Copyright © 2013 Rightpoint | Proprietary and Confidential 19
LETS WALK THROUGH THIS SCENARIO
• “Our Director has asked us for a new
search vertical called “Sporting
Events which should only show
sporting events from our site
collection. He has also asked us to
remove the video’s search vertical
since it is no longer needed. Mr.
Scott wants a refiner for sport and
wants the totals to be shown for all
refiners. Mr. Scott doesn’t stop
asking for things so she also wants a
date slider for the event”
20. Copyright © 2013 Rightpoint | Proprietary and Confidential 20
SO…. LETS KNOCK THIS OUT
• What needs to be done
– Create a new search page called
eventresults
– Create a result source called Sporting
Events
• ContentTypeId:0x0100075507D00BC9714D90
205DAB58E1F2D9* AND
Path:{SiteCollection.URL}
– Update the navigation to delete Videos
– Apply our Result Source
– Add Sport to the refinement panel
• Update the refiner display template to
show totals
• Add a date slider refiner
21. Copyright © 2013 Rightpoint | Proprietary and Confidential 21
DISPLAY TEMPLATES
• Really we could spend an entire
session on display templates, but I
wanted to touch on:
– how they are comprised
– best practices,
– walk through how you add a new
managed property,
– starting syntax,
– how to view managed property values.
– What controls the number of items to
return?
for(var p in ctx.CurrentItem)
{
console.log(p+”:”+$getItemValue(ctx,p));
}
22. Copyright © 2013 Rightpoint | Proprietary and Confidential 22
LETS WALK THROUGH A VERY SIMPLE ONE
• Lets take a look at the suggest reads
item template
23. Copyright © 2013 Rightpoint | Proprietary and Confidential 23
WHERE CAN I GET A COPY OF THESE NIFTY SLIDES?
• http://www.slideshare.net/dtadams123/march-spug
25. 29 North Wacker Drive | 4th Floor | Chicago, Illinois 60606
312.920.8383 | 312.920.8384 fax
rightpoint.com
Editor's Notes This isn’t a talking to, this is a conversation feel free to participate! Is anyone using these features, if so how are you using them? Search Vertical:
Think of search verticals like the different options in a google search i.e. images, videos, etc.
Each Vertical should go to another search page with a result source configured for the page. The default videos search vertical navigates to the video results page with a result source only grabbing videos.
Control Template:
A control template acts as the container for each search result item within it. Think of a carton of eggs, the carton itself represents the control template and each search result is an egg.
You wouldn't carry eggs without a carton right!
Item Template:
The item template determines how the item will be formatted. A result type determines what template should be used. An example being if the item returned is of type web page, I want to use my custom item template which gives the title an H1Black heading.
Refinement Panel:
This contains the refiners that you have configured. Remember: Single item refiners and multi select refiners use different display templates. Site Settings -> Site Collection Administration -> Search Settings
For a particular site’s searching experience there is a option for each site as well Author and Family would be our managed properties and our crawled properties would be the items below it.
A few exceptions for the managed properties, such as calculated fields
The properties can be viewed by going to your search schema
-Explain what all of the properties do What do you guys think we need to do to make this happen? Refiners located at
All Files -> -catalogs -> masterpage -> Display Templates -> Filters -> Filter Default
Update showcounts: from false to true Where can I find the display templates?
All Files -> -catalogs -> masterpage -> Display Templates -> next step depends on what you are altering
Best Practices:
Always make updates to the HTML file, don’t update the javascript file! The files are associated so any updates made to your JS in your html file will be reflected in your JS file.
You can use either ctx.CurrentItem.ManagedProperty i.e. ctx.CurrentItem.Author for the text string
You can use $getItemValue(ctx, “ManagedProperty”); for the object How do I decide how many items to return? You do that in the properties of the web part. Any Follow up Questions?