19
Leveraging SharePoint Search In SharePoint 2013 Jameson Bozeman

Leveraging SharePoint 2013 Search and CSR

Embed Size (px)

Citation preview

Page 1: Leveraging SharePoint 2013 Search and CSR

Leveraging SharePoint Search

In SharePoint 2013

Jameson Bozeman

Page 2: Leveraging SharePoint 2013 Search and CSR

Session Preview

Why SearchOut of the Box WinsQueries – Getting your ItemsManaged Properties – Getting your ContentDisplay Templates – Getting your Branding onCustom Solutions

Page 3: Leveraging SharePoint 2013 Search and CSR

Why Search2010 ScenarioContent Query Web parts

Limited ScopeResource HogHard to Modify Layout with XSLT

Page 4: Leveraging SharePoint 2013 Search and CSR

Why Search2013 ScenarioContent Search Web parts

Minimized SQL LoadMore control over QueriesEasy Control of Display using Client Side RenderingPull from across Site Collections

4 |

Page 5: Leveraging SharePoint 2013 Search and CSR

Out of the Box

5 |

DEMO

Page 6: Leveraging SharePoint 2013 Search and CSR

CSWP Concepts

6 |

QueryGet Items

Managed PropertiesUsable Columns from

Items

Display TemplatesMake it Pretty

Page 7: Leveraging SharePoint 2013 Search and CSR

Queries – KQL Syntax

KQL Syntax Reference - https://msdn.microsoft.com/en-us/library/office/ee558911.aspxToken Reference - https://technet.microsoft.com/en-us/library/jj683123.aspx

7 |

Page 8: Leveraging SharePoint 2013 Search and CSR

Result SourcesBenefits of Result Sources

Faster QueriesLess Server LoadSimplifies Advanced queries for Power UsersBetter Change Control

8 |

Page 9: Leveraging SharePoint 2013 Search and CSR

Managed Properties

Site Column Name Crawled Property Managed Property

Item Number Ows_q_TEXT_ProductCatalogItemNumber

ProductCatalogItemNumberOWSText

Group Number Ows_q_TEXT_ProductCatalogGroupNumber

ProductCatalogGroupNumberOWSTEXT

Rollup Image ows_r_IMGE_PublishingRollupImage

PublishingImage

Language Tag Ows_q_CHCS_ProductCatalogLanguageTag

ProductCatalogLanguageTagOWSCHCS

Title Title Title9 |

Crawled Property: Raw content extracted from crawls

Managed Property: Search web parts use to display content, consists of 1 or more mapped Crawled Properties

Page 10: Leveraging SharePoint 2013 Search and CSR

Managed Properties

10 |

How do Managed Properties get created?Managed Properties automatically created for Site Columns Column has Content in SharePoint List/LibraryFull CrawlSite Column Name

Crawled Property

Managed Property

Title Title Title

Item Number Ows_q_TEXT_ProductCatalogItemNumber

ProductCatalogItemNumberOWSText

Group Number Ows_q_TEXT_ProductCatalogGroupNumber

ProductCatalogGroupNumberOWSTEXT

Rollup Image ows_r_IMGE_PublishingRollupImage

PublishingImage

Language Tag Ows_q_CHCS_ProductCatalogLanguageTag

ProductCatalogLanguageTagOWSCHCS

Page 11: Leveraging SharePoint 2013 Search and CSR

Managed Properties

11 |

Managed Properties are now set under Search Schema in the Central Admin or Site Settings.

Searchable: Includes the content of the property in the index, making it searchable as a query term alone. Queryable: Property can be used in queries such as Property:Value. Retrievable: Property can be returned to the result set for display or programmatic usage.Refinable: Property can be returned in refiners. Sortable: Properties can be used for sorting.

Page 12: Leveraging SharePoint 2013 Search and CSR

Continuous Crawl

12 |

Increased Freshness and Managed Property Creation

Tip: Full Crawl is not required for Managed Property creation if Reindex List is selected and continuous crawl is turned on.

Manage Continuous Crawl Interval with Powershell (default 15 mins)

$ssa = Get-SPEnterpriseSearchServiceApplication

$ssa.SetProperty("ContinuousCrawlInterval",5)

$ssa = Get-SPEnterpriseSearchServiceApplication $ssa.SetProperty("ContinuousCrawlInterval",n)

Page 13: Leveraging SharePoint 2013 Search and CSR

Display Templates

13 |

Page 14: Leveraging SharePoint 2013 Search and CSR

Display Templates

14 |

Creating Display Templates

Start with copy of other OOTB HTML display template

Always edit HTML Display Template SharePoint generates the corresponding JS File automatically

Page 15: Leveraging SharePoint 2013 Search and CSR

CSWP Licensing

15 |

Content Search web parts are only included in SharePoint Enterprise or SharePoint Online

Tips: Search Results (in all versions of SharePoint) web parts can use most CSWP display templates.

Difference: Managed Properties need to be mapped out in the display template, no easy mapping in Web Part Settings.

Page 16: Leveraging SharePoint 2013 Search and CSR

Overriding Queries

16 |

Queries can be overridden for Search Web Parts using Client Side Code, without reloading page!

Example:Srch.ScriptApplicationManager.get_current().queryGroups['e77e5f8b-e52f-46d8-a04c-7f9d83284858'].dataProvider.set_queryTemplate('ContentType:"Document"')

 

Srch.ScriptApplicationManager.get_current().queryGroups['e77e5f8b-e52f-46d8-a04c-7f9d83284858'].dataProvider.issueQuery()

DEMO

Page 17: Leveraging SharePoint 2013 Search and CSR

Search Rest APIExample Rest URI: http://server/_api/search/query?querytext=’SharePoint’

Retrieve search results in JSON Format: data.d.query.PrimaryQueryResult.RelevantResults.Table.Rows.results

17 |

Page 18: Leveraging SharePoint 2013 Search and CSR

When not to use SearchPulling from a single location

Complex logic needed for filtering of items

Limited or failing SharePoint hardware

Need freshness of less than 5 minutes

18 |

Page 19: Leveraging SharePoint 2013 Search and CSR

Any Questions?