Building Search Driven Applications
Brian Caauwe – Manager, Business Productivity
January 20th, 2018
Agenda
Who am I?
• Brian Caauwe
• Manager, Consultant, Speaker and new dad of 2
• Email: bcaauwe@avtex.com
• Twitter: @bcaauwe
• Technical Editor
• Professional SharePoint 2013 Administration
• Certifications
• MCM: SharePoint Server 2010
• MCSM: SharePoint
Gold Sponsors
SHAREPOINT SATURDAY
ST.LOUIS 2018
Silver Sponsors
Bronze Sponsors
SharePoint Environment
Poll
• SharePoint 2007
• SharePoint 2010
• SharePoint 2013
• SharePoint 2016
• SharePoint Online
Search Schema
Properties Power
the Search Experience
Crawled Property
vs.
Managed Property
• ALL crawled metadata available into Categories
• Basic
• Business Data
• Document Parser
• Internal
• Mail
• MetadataExtractor
• Notes
• Office
• People
• SharePoint
• Tiff
• Web
• XML
Crawled
Property
If it’s not a managed property, you can’t use it in search
• Identify what you can do with it
• Searchable
• Queryable
• Retrievable
• Allow Multiple Values
• Refinable
• Sortable
• Safe for Anonymous
• Map one or many crawled properties
Managed
Property
Configuration Options
• Service Application (Central Administration)
• Tenant (SharePoint Online Administration)
• Site Collection (Site Collection Administrators)
• Site (Site Owners)
Managed
Property
Search Settings
• Predefined starting place
• Think “Scopes” previously
• Settings
• Protocol
• Type
• Query Transform
Result
Source
• Query Examples
• Local SharePoint results (Everything but people)
{?{searchTerms} -ContentClass=urn:content-class:SPSPeople}
• Pictures
{?path:{Scope}} {?owstaxIdMetadataAllTagsInfo:{Tag}}
(ContentTypeId:0x0101009148F5A04DDD49cbA7127AADA5FB792B00AADE34325A8
B49cdA8BB4DB53328F214* OR ContentTypeId:0x010102*)
Used in Search web parts
Quick Mode
Advanced Mode
Result
Source
Used in Search web parts
Result
Type
• Used to automatically define Display Templates
• Add conditions
• Configurable in Search Results web part
Query
Rules
• Think Best Bets
• Context: Bound to Result Sources
• Query Conditions
• Example: ContentTypeId:0x0102* (e.g. Event)
• Actions
• Promoted results
• Best Bet
• Visual Best Bet
Query
Rules
• Actions
• Result Blocks
• Tune Ranking
• Change sorting (e.g. Promote PDF to top)
Query
Rules
Search Patterns
• Search Results
• Tuned for use in Search Center
• Paging
• Alerting
• Sorting
• Advanced Search
• Search Preferences
• Promoted Results
• Result Count
• Language Dropdown
Web Parts
• Content Search
• Requires Enterprise
• Tuned for use OUTSIDE Search Center
• Override Property Mappings
• Use with MULTIPLE web parts
• Limited set of Display Templates
Web Parts
• Query String Parameters
{QueryString.QueryParameter}
• URL Tokens
{URLToken.1}
• User Profile Properties
{User.UserProfilePropertyInternalName}
• Site Properties
{Site.Url}
{Site.PropertyBagProperty}
• Site Collection Properties
{SiteCollection.Url}
{SiteCollection.PropertyBagProperty}
• Page Properties
{Page.InternalFieldName}
TechNet - https://technet.microsoft.com/en-us/library/jj683123.aspx
Query
Variables
• Query the SharePoint Index using JavaScript
• Troubleshooting - View results in XML format in browser
REST API
• FREE JQuery Plug-in
• Flexible Display & Themeable
• Type ahead search
• Sorting
• Filtering
https://datatables.net/
REST API
+
Datatables
Demo
Search Patterns
Display Templates
• Stored in the Master Page Gallery
• ~sitecollection/_catalogs/masterpage/Display Templates
• Javascript & HTML mockup
• Utilizes Retrievable Managed Properties
• Upload HTML file / generates JS file
• DON’T TOUCH THE JS FILE
• Usage Patterns
• Search Results
• Search Hover Panel
• Content Web Parts
• Refinement
• Search Box
• Custom Locations
Control
Template
• Specifies the outer container
• Example
• List with Paging
• Slideshow
• Extensibility
• Grid
• Sharegate Slider
Item
Template
Specifies the inner container
• Examples
• Search Results (Item_Picture, Item_PDF)
• Specifies the Hover Panel Template
• Content Search (Item_LargePicture)
• Extensibility
• Change hover panel template
• Add / Change Properties
• Integrate with 3rd party services
• Specify ALL managed properties
needed in Item AND Hover templates
Hover
Template
• Specifies the hover container
• Examples
• Item_PDF_HoverPanel
• Item_Person_HoverPanel
• Extensibility
• Add additional properties
• Change Actions
Filter
Template
• Specifies the refinement container
• Example
• Filter_Default
• Extensibility
• Add Counts
• Swap text for images
• Display in Dropdown
• MORE
Demo
Display Templates
How to get ahold of me?
Brian Caauwe
• Email: bcaauwe@avtex.com
• Twitter: @bcaauwe
• SlideShare: https://www.slideshare.net/BrianCaauwe
• Microsoft Tech Community:
https://techcommunity.microsoft.com/t5/user/viewprofilepage/user-id/2831
• MNSPUG: http://www.sharepointmn.com
Resources
• Search Schema Overview - https://technet.microsoft.com/en-
us/library/jj219669(office.15).aspx
• Query Variables - https://technet.microsoft.com/en-
us/library/jj683123.aspx
• SharePoint Search REST API - https://msdn.microsoft.com/en-
us/library/office/jj163876.aspx
• DataTables Plug-in - https://datatables.net/
• Sharegate Slider - http://en.share-gate.com/blog/sharepoint-slider-
display-template
• Bing Maps Integration - https://www.bingmapsportal.com/
• Dropdown Search Refiner Control - https://www.eliostruyf.com/part-4-
create-dropdown-search-refiner-control/
SPSSTL - Building Search Driven Applications

SPSSTL - Building Search Driven Applications

  • 1.
    Building Search DrivenApplications Brian Caauwe – Manager, Business Productivity January 20th, 2018
  • 2.
  • 3.
    Who am I? •Brian Caauwe • Manager, Consultant, Speaker and new dad of 2 • Email: bcaauwe@avtex.com • Twitter: @bcaauwe • Technical Editor • Professional SharePoint 2013 Administration • Certifications • MCM: SharePoint Server 2010 • MCSM: SharePoint
  • 4.
    Gold Sponsors SHAREPOINT SATURDAY ST.LOUIS2018 Silver Sponsors Bronze Sponsors
  • 5.
    SharePoint Environment Poll • SharePoint2007 • SharePoint 2010 • SharePoint 2013 • SharePoint 2016 • SharePoint Online
  • 6.
  • 7.
  • 8.
  • 9.
    • ALL crawledmetadata available into Categories • Basic • Business Data • Document Parser • Internal • Mail • MetadataExtractor • Notes • Office • People • SharePoint • Tiff • Web • XML Crawled Property
  • 10.
    If it’s nota managed property, you can’t use it in search • Identify what you can do with it • Searchable • Queryable • Retrievable • Allow Multiple Values • Refinable • Sortable • Safe for Anonymous • Map one or many crawled properties Managed Property
  • 11.
    Configuration Options • ServiceApplication (Central Administration) • Tenant (SharePoint Online Administration) • Site Collection (Site Collection Administrators) • Site (Site Owners) Managed Property
  • 12.
  • 13.
    • Predefined startingplace • Think “Scopes” previously • Settings • Protocol • Type • Query Transform Result Source • Query Examples • Local SharePoint results (Everything but people) {?{searchTerms} -ContentClass=urn:content-class:SPSPeople} • Pictures {?path:{Scope}} {?owstaxIdMetadataAllTagsInfo:{Tag}} (ContentTypeId:0x0101009148F5A04DDD49cbA7127AADA5FB792B00AADE34325A8 B49cdA8BB4DB53328F214* OR ContentTypeId:0x010102*)
  • 14.
    Used in Searchweb parts Quick Mode Advanced Mode Result Source
  • 15.
    Used in Searchweb parts Result Type • Used to automatically define Display Templates • Add conditions • Configurable in Search Results web part
  • 16.
    Query Rules • Think BestBets • Context: Bound to Result Sources • Query Conditions • Example: ContentTypeId:0x0102* (e.g. Event)
  • 17.
    • Actions • Promotedresults • Best Bet • Visual Best Bet Query Rules
  • 18.
    • Actions • ResultBlocks • Tune Ranking • Change sorting (e.g. Promote PDF to top) Query Rules
  • 19.
  • 20.
    • Search Results •Tuned for use in Search Center • Paging • Alerting • Sorting • Advanced Search • Search Preferences • Promoted Results • Result Count • Language Dropdown Web Parts
  • 21.
    • Content Search •Requires Enterprise • Tuned for use OUTSIDE Search Center • Override Property Mappings • Use with MULTIPLE web parts • Limited set of Display Templates Web Parts
  • 22.
    • Query StringParameters {QueryString.QueryParameter} • URL Tokens {URLToken.1} • User Profile Properties {User.UserProfilePropertyInternalName} • Site Properties {Site.Url} {Site.PropertyBagProperty} • Site Collection Properties {SiteCollection.Url} {SiteCollection.PropertyBagProperty} • Page Properties {Page.InternalFieldName} TechNet - https://technet.microsoft.com/en-us/library/jj683123.aspx Query Variables
  • 23.
    • Query theSharePoint Index using JavaScript • Troubleshooting - View results in XML format in browser REST API
  • 24.
    • FREE JQueryPlug-in • Flexible Display & Themeable • Type ahead search • Sorting • Filtering https://datatables.net/ REST API + Datatables
  • 25.
  • 26.
  • 27.
    • Stored inthe Master Page Gallery • ~sitecollection/_catalogs/masterpage/Display Templates • Javascript & HTML mockup • Utilizes Retrievable Managed Properties • Upload HTML file / generates JS file • DON’T TOUCH THE JS FILE • Usage Patterns • Search Results • Search Hover Panel • Content Web Parts • Refinement • Search Box • Custom Locations
  • 28.
    Control Template • Specifies theouter container • Example • List with Paging • Slideshow • Extensibility • Grid • Sharegate Slider
  • 29.
    Item Template Specifies the innercontainer • Examples • Search Results (Item_Picture, Item_PDF) • Specifies the Hover Panel Template • Content Search (Item_LargePicture) • Extensibility • Change hover panel template • Add / Change Properties • Integrate with 3rd party services • Specify ALL managed properties needed in Item AND Hover templates
  • 30.
    Hover Template • Specifies thehover container • Examples • Item_PDF_HoverPanel • Item_Person_HoverPanel • Extensibility • Add additional properties • Change Actions
  • 31.
    Filter Template • Specifies therefinement container • Example • Filter_Default • Extensibility • Add Counts • Swap text for images • Display in Dropdown • MORE
  • 32.
  • 34.
    How to getahold of me? Brian Caauwe • Email: bcaauwe@avtex.com • Twitter: @bcaauwe • SlideShare: https://www.slideshare.net/BrianCaauwe • Microsoft Tech Community: https://techcommunity.microsoft.com/t5/user/viewprofilepage/user-id/2831 • MNSPUG: http://www.sharepointmn.com
  • 35.
    Resources • Search SchemaOverview - https://technet.microsoft.com/en- us/library/jj219669(office.15).aspx • Query Variables - https://technet.microsoft.com/en- us/library/jj683123.aspx • SharePoint Search REST API - https://msdn.microsoft.com/en- us/library/office/jj163876.aspx • DataTables Plug-in - https://datatables.net/ • Sharegate Slider - http://en.share-gate.com/blog/sharepoint-slider- display-template • Bing Maps Integration - https://www.bingmapsportal.com/ • Dropdown Search Refiner Control - https://www.eliostruyf.com/part-4- create-dropdown-search-refiner-control/

Editor's Notes

  • #10 Category Examples Basic – Basic:16  LastModifiedTime or DAV:contentclass  contentclass Business Data – Mapped from the BCS … EntityName & EntityNamespace includes fields from ReadList Operations Document Parser – Author and FileType Internal – Yet another set of Author properties Mail – If crawling Exchange MetadataExtractor – Extractor properties for Title and Author Notes Office – Embedded MSFT Office document properties such as Office:2  Title People – SharePoint User Profile Properties INTERNAL names SharePoint – ALL list / library columns follow pattern of ows_InternalName Tiff – N/A out of the box Web – Used for crawling external web sites XML – N/A out of the box
  • #11 Managed Property Settings Searchable – Add values of this property to the full text index. Can find information on this property without needing to do keyword based searching Queryable – Do you want to be able to use this property in keyword based searches (e.g. propertyname:”value”) Retrieveable – Do you want to use this property in Display templates Allow Multiple Values – Is there a potential that this property may have multiple values Refinable – Do you want to be able to setup a refiner for this property (if used, also needs to be Queryable) Sortable – Do you want to be able to sort on this property Safe for Anonymous – Can this property be used / seen from an anonymous user
  • #12 Configuration Options Service Application – Full control… create, delete change all settings. Changes effect the ENTIRE farm Tenant – Create new TEXT properties, add alias to existing properties. Changes effect the ENTIRE SharePoint Online Tenant Site Collection – Create new TEXT properties, add alias to existing properties. Changes effect the site collection and can override the Service Application / Tenant Configuration Site - Create new TEXT properties, add alias to existing properties. Changes effect the site collection and can override the Site Collection Configuration
  • #26 Demo [10 minutes] Content Search web part Query String Variables REST API Show results in the UI Data Tables Show the FULL code Show Stores
  • #33 Demo [10 Minutes] Stores Store Demographics (Content Search - Simple Item Template) Bing Maps Integration (Content Search - Complex Item Template) Store Contacts (Control Template) Pez Photo Horizontal (Search Result Item Template) Photo Hover Panel (Hover Template) Refiners (Counts, Dropdown, Image Replacement) General Search Home Page People Search (Sorting) Everything Result Block (Panel) Promoted Result Pez –Simple Avtex – Visual