Search Driven Solutions

44
Please help us! Thank our Sponsors:

Transcript of Search Driven Solutions

Page 1: Search Driven Solutions

Please help us!Thank our Sponsors:

Page 2: Search Driven Solutions

Search Driven Solutions

April Dunnam

Page 3: Search Driven Solutions

Please be courteous to your fellow attendees

and

set your phones to vibrate or silent mode!

Please Be Courteous!

Page 4: Search Driven Solutions

April Dunnam / SharePoint Developer

• Partner & Lead Consultant/Developer at ThriveFast• SharePoint junkie since 2007• Blogger, Speaker• Karaoke Queen

@2016 ThriveFast | www.thrivefast.com

@aprildunnam | www.sharepointsiren.com

Page 5: Search Driven Solutions

Agenda

• Intro to Search• Display Templates

• Components• Pre-built templates• Creating custom templates

• Content Search Web Part (CSWP)• Feature Availability• What is it?• Query Builder• Demo

• Search Results Web Part (SRWP)@2016 ThriveFast | www.thrivefast.com

@aprildunnam | www.sharepointsiren.com

Page 6: Search Driven Solutions

Intro to Search

@2016 ThriveFast | www.thrivefast.com

@aprildunnam | www.sharepointsiren.com

Page 7: Search Driven Solutions

A Case for Search

• Doesn’t require a developer most of the time• Replaces need for custom development

• Less code• Easily maintainable • Better performance

@2016 ThriveFast | www.thrivefast.com

@aprildunnam | www.sharepointsiren.com

Page 8: Search Driven Solutions

Performance Benefits

• Doesn’t require a call to the database like jQuery based solutions• Reads from the search index rather than the database• Get performance benefits of custom code without having to

write it

@2016 ThriveFast | www.thrivefast.com

@aprildunnam | www.sharepointsiren.com

Page 9: Search Driven Solutions

@2016 ThriveFast | www.thrivefast.com

@aprildunnam | www.sharepointsiren.com

Sounds Great But…

Page 10: Search Driven Solutions

The Catch – Don’t Use If..

• If you don’t have SharePoint 2013 or SPO• If you need real time

• Dependent on Search Crawl Schedule – More on this later• You don’t have control over Managed Properties • If you need to edit

• Search Web Parts are meant to be view only• Not a forms solutions

@2016 ThriveFast | www.thrivefast.com

@aprildunnam | www.sharepointsiren.com

Page 11: Search Driven Solutions

What if you have SP 2010?

• Content Query Web Part• Search Core Results Web Part• Custom Code

@2016 ThriveFast | www.thrivefast.com

@aprildunnam | www.sharepointsiren.com

Page 12: Search Driven Solutions

Search Crawls

• SPO• MS controls Search Crawl scheduling and execution• Search crawls occur continuously to make sure that content changes are

available through search results as soon as possible. Recently uploaded documents may not immediately be displayed in search results because of the time that’s required to process them. SharePoint Online targets between 15 minutes and an hour for the time between upload and availability in search results (also known as index freshness). In cases of heavy environment use, this time can increase to six hours.

• On Premises• SharePoint Admin can configure crawl schedule and can trigger an on-

demand crawl if you request it

@2016 ThriveFast | www.thrivefast.com

@aprildunnam | www.sharepointsiren.com

Page 13: Search Driven Solutions

Search Components

@2016 ThriveFast | www.thrivefast.com

@aprildunnam | www.sharepointsiren.com

Page 14: Search Driven Solutions

Crawled Properties

• Metadata that is extracted from documents/lists during crawls• Can be structured content

• Title, Author, etc• Or unstructured content

• Keywords, language, etc• To make a crawled property available for search queries,

you must map the crawled property to a managed property

@2016 ThriveFast | www.thrivefast.com

@aprildunnam | www.sharepointsiren.com

Page 15: Search Driven Solutions

Managed Properties

• Exists in the Search Index• Grouping of one or more Crawled Properties• Users can only search on managed properties and not on

crawled properties• Must have access to Central Admin to create/modify

@2016 ThriveFast | www.thrivefast.com

@aprildunnam | www.sharepointsiren.com

Page 16: Search Driven Solutions

Managed Property Settings

@2016 ThriveFast | www.thrivefast.com

@aprildunnam | www.sharepointsiren.com

Mapped Property Setting Description

Searchable Specifies that the managed property content can be found in the full-text index

Queryable Enables querying against the specific managed property. Good if you want to search for something specifically in a column. For example, if the property is Department you could query “Department: Accounting”

Retrievable Enables the managed property content to be returned in search results

Refinable Enables the managed property to be used as a refiner for search results

Sortable Must be selected if you want to be able to sort (a-z) by this field in your search solution

Page 17: Search Driven Solutions

Search Tools

• SharePoint Search Query Tool• https://sp2013searchtool.codeplex.com • Works for SharePoint 2013 On-Prem and Online• Simulate and debug queries

@2016 ThriveFast | www.thrivefast.com

@aprildunnam | www.sharepointsiren.com

Page 18: Search Driven Solutions

What’s a Display Template

@2016 ThriveFast | www.thrivefast.com

@aprildunnam | www.sharepointsiren.com

Page 19: Search Driven Solutions

Display Template Overview

• JavaScript based content rendering template• Transforms query results into custom format• Uses Client Side Rendering (CSR)• Doesn’t require you work with XSLT anymore• Create and edit HTML files while SharePoint handles the JS

@2016 ThriveFast | www.thrivefast.com

@aprildunnam | www.sharepointsiren.com

Page 20: Search Driven Solutions

Display Template Components

• Control• Container for the search results

• Item• Controls what happens to each

item rendered through the query• Used once per result• Use Managed Properties here to

display content

@2016 ThriveFast | www.thrivefast.com

@aprildunnam | www.sharepointsiren.com

Page 21: Search Driven Solutions

Where are they located

• Located in the Master Page Gallery• /_catalogs/masterpage/display templates• Content Search Folder• Search Folder

• Each template will include a .html and a .js file

@2016 ThriveFast | www.thrivefast.com

@aprildunnam | www.sharepointsiren.com

Page 22: Search Driven Solutions

Tips/Warnings

• Create a new folder to upload custom templates to• Separates them from the out-of-the-box templates• Easier to find

• Don’t touch the JS file• Customize the HTML file only!• Never modify an Out-Of-The-Box Display Template!

• Make a copy of it if you want to use it as a starting point to customize

@2016 ThriveFast | www.thrivefast.com

@aprildunnam | www.sharepointsiren.com

Page 23: Search Driven Solutions

Pre-Built Display Templates

@2016 ThriveFast | www.thrivefast.com

@aprildunnam | www.sharepointsiren.com

Page 24: Search Driven Solutions

Some Cool Display Templates

• ShareGate• Animated Menu - http://

en.share-gate.com/blog/sharepoint-2013-animated-menu-search-display-template

• Image Menu - http://en.share-gate.com/blog/sharepoint-display-template • Image Slider - http://

en.share-gate.com/blog/image-slider-with-sharepoint-2013-search-results • Corporate Directory - http://

en.share-gate.com/blog/corporate-directory-sharepoint-search • SharePoint Client Side Repository (SPCSR)

• https://github.com/SPCSR/DisplayTemplates • My Stuff

• https://github.com/aprildunnam/DisplayTemplates @2016 ThriveFast | www.thrivefast.com

@aprildunnam | www.sharepointsiren.com

Page 25: Search Driven Solutions

Creating Display Templates

@2016 ThriveFast | www.thrivefast.com

@aprildunnam | www.sharepointsiren.com

Page 26: Search Driven Solutions

Create a Display Template

• Start from an existing template• Make a copy of the .html of an existing template

• If you have publishing enabled then SharePoint will create the JS for you

• If you don’t have publishing enabled then you will need to copy both the .html and js

• Make sure to change the <title> tag to the name of your new template• Modify the code to fit your needs

@2016 ThriveFast | www.thrivefast.com

@aprildunnam | www.sharepointsiren.com

Page 27: Search Driven Solutions

Display Template

DEMO@2016 ThriveFast | www.thrivefast.com

@aprildunnam | www.sharepointsiren.com

Page 28: Search Driven Solutions

Content Search Web Part

@2016 ThriveFast | www.thrivefast.com

@aprildunnam | www.sharepointsiren.com

Page 29: Search Driven Solutions

Feature Availability

• The Content Search Web Part (CSWP) is only available for the following licenses:• SharePoint 2013 On-Prem Enterprise License• SharePoint Online Plan 2 (Office 365 E3/E4/E5)

• Don’t have an Enterprise License? • You can still use the Search Result Web Part (SRWP) and get similar

functionality (kind of)

@2016 ThriveFast | www.thrivefast.com

@aprildunnam | www.sharepointsiren.com

Page 30: Search Driven Solutions

Functionality Matrix

@2016 ThriveFast | www.thrivefast.com

@aprildunnam | www.sharepointsiren.com

Functionality CSWP SRWPProperty Mappings w/ Web Part settings X -Don’t show anything if no results X X (Requires custom control

template)Start displaying results from specified result #

X X

Caching Support X -Support Content Routing, choosing result table

X -

Paging support X XRefine/Filter Results X X

Note: Adapted from “Content Search WebPart vs Search Results Web Part” by ITUnity

Page 31: Search Driven Solutions

Content Search Building Blocks

• The Content Search Web Part is comprised of 2 elements:

1. Query BuilderGathers your data

2. Display TemplateBeautifies the output

@2016 ThriveFast | www.thrivefast.com

@aprildunnam | www.sharepointsiren.com

Page 32: Search Driven Solutions

Query Builder

• Where you define what data to show• Can search across site

collections & subsites • Examples:

• Query all subsites• Query for data from a specific list• Query for all pictures• Query for all people

@2016 ThriveFast | www.thrivefast.com

@aprildunnam | www.sharepointsiren.com

Page 33: Search Driven Solutions

Built-in Templates

• Multiple default templates to choose from• Built-in Slideshow functionality

@2016 ThriveFast | www.thrivefast.com

@aprildunnam | www.sharepointsiren.com

Page 34: Search Driven Solutions

CSWP Default Slider

@2016 ThriveFast | www.thrivefast.com

@aprildunnam | www.sharepointsiren.com

Page 35: Search Driven Solutions

Property Mapping

• Where you define what data to show• Map the managed properties to

the corresponding line in the display template

@2016 ThriveFast | www.thrivefast.com

@aprildunnam | www.sharepointsiren.com

Page 36: Search Driven Solutions

Content Search Web Part (CSWP)

DEMO@2016 ThriveFast | www.thrivefast.com

@aprildunnam | www.sharepointsiren.com

Page 37: Search Driven Solutions

Search Results Web Part

@2016 ThriveFast | www.thrivefast.com

@aprildunnam | www.sharepointsiren.com

Page 38: Search Driven Solutions

Search Results Web Part

• Use this if you don’t have access to the CSWP• Can accomplish all of the same functionality as CSWP• Requires more code and configuration• Doesn’t have property mappings

@2016 ThriveFast | www.thrivefast.com

@aprildunnam | www.sharepointsiren.com

Page 39: Search Driven Solutions

Search Results Web Part

DEMO@2016 ThriveFast | www.thrivefast.com

@aprildunnam | www.sharepointsiren.com

Page 40: Search Driven Solutions

Provisioning

• Suggest creating/editing your display templates in a test environment if possible• If you have publishing enabled:

• Copy your .html file and any corresponding css/images to your production master page gallery/display templates folder

• If you don’t have publishing enabled:• Copy both the .html and .js and any corresponding css/images to

your production master page gallery/display templates folder

Page 41: Search Driven Solutions

What did we learn kids?

• Content Search Web Part is cool• Search Results Web Part is there for you if you don’t have

the licensing for CSWP• If your on SharePoint 2010 or Below upgrade to 2013 so

you can reap the benefits• Lots of out-of-the box templates available• Cool templates out there to download (for free)• Puts the power in your hands & eliminates the need for

custom code

Page 42: Search Driven Solutions

Thank You

@2016 ThriveFast | www.thrivefast.com

@aprildunnam | www.sharepointsiren.com

Page 43: Search Driven Solutions

Please Complete An Evaluation FormYour input is important!

You can access Evaluation Forms at:

http://TulsaTechFest.com

Fill them out!

You can win additional prizes!

Like a $50 Best Buy Gift Card!!

Winner drawn – Midnight, Sun Aug 7th!

Page 44: Search Driven Solutions

Please help us!Thank our Sponsors: