Teaching users at all technical levels how to use SharePoint 2013’s search webparts to display content from any location with custom visuals. This session will also discuss the strengths and limitations of search along with best practices for implementing search solutions.
2. Session Preview
Why Search
Out of the Box Wins
Queries – Getting your Items
Managed Properties – Getting your Content
Display Templates – Getting your Branding on
Custom Solutions
4. Why Search
2013 Scenario
Content Search Web parts
Minimized SQL Load
More control over Queries
Easy Control of Display using Client Side Rendering
Pull from across Site Collections
4 |
8. Result Sources
Benefits of Result Sources
Faster Queries
Less Server Load
Simplifies Advanced queries for Power Users
Better Change Control
8 |
9. Managed Properties
Site Column Name Crawled Property Managed Property
Item Number Ows_q_TEXT_ProductCat
alogItemNumber
ProductCatalogItemNumbe
rOWSText
Group Number Ows_q_TEXT_ProductCat
alogGroupNumber
ProductCatalogGroupNum
berOWSTEXT
Rollup Image ows_r_IMGE_PublishingR
ollupImage
PublishingImage
Language Tag Ows_q_CHCS_ProductCat
alogLanguageTag
ProductCatalogLanguageT
agOWSCHCS
Title Title Title
9 |
Crawled Property: Raw content extracted from crawls
Managed Property: Search web parts use to display content,
consists of 1 or more mapped Crawled Properties
10. Managed Properties
10 |
How do Managed Properties get created?
Managed Properties automatically created for Site
Columns
Column has Content in SharePoint List/Library
Full Crawl
Site Column Name Crawled Property Managed Property
Title Title Title
Item Number Ows_q_TEXT_Product
CatalogItemNumber
ProductCatalogItemNu
mberOWSText
Group Number Ows_q_TEXT_Product
CatalogGroupNumber
ProductCatalogGroupN
umberOWSTEXT
Rollup Image ows_r_IMGE_Publishin
gRollupImage
PublishingImage
Language Tag Ows_q_CHCS_Product
CatalogLanguageTag
ProductCatalogLanguag
eTagOWSCHCS
11. 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.
12. 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)
14. 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
15. 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.
16. 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
17. Search Rest API
Example Rest URI:
http://server/_api/search/query?querytext=’SharePoint’
Retrieve search results in JSON Format:
data.d.query.PrimaryQueryResult.RelevantResults.Table.
Rows.results
17 |
18. When not to use Search
Pulling from a single location
Complex logic needed for filtering of items
Limited or failing SharePoint hardware
Need freshness of less than 5 minutes
18 |