search driven architecture in sharepoint
TRANSCRIPT
Search Driven Architecturein
SharePoint
Jim Lennox and Mark Passando
Contact:
[email protected] [email protected]://www.linkedin.com/in/markpassando
[email protected]://www.linkedin.com/in/jim-lennox-15ab1442
Shoulders of Giants!• Bella Engen• Elio Struyf• Benjamin Niaulin• Marc Anderson
• Andrew Connell• Bob German
The Search Problem…
Where are my keys?…
The Search Solution
Ah! Always the last place I look…
But at times…
It still feels like this…
We want our customers…
to just do this…
Definitions!I have seen various definitions:• Using Search as a data access technology• Using Search as the interface and presentation• Extending the current search center• Adding dynamic URL’s that have search queries imbedded in them
Benefit of Search Driven Architecture• Less risky, no code deployment .vs. configurations• We troubleshoot results rather than code• Much faster than development cycles and code
• More over, we separate the content architects and developers from the SharePoint architects and developers
• No need to give everyone access to the content site collection
Online versus On Premise• Product Catalog is distributed• Can create Managed Properties in a limited way• Only Text and Yes/No• Not Refinable or Sortable• Lists are not automatically re-indexed
• Crawls and indexing at the mercy of Microsoft’s schedule
Pattern Reference (MVC)
Model
View
Controller
Cross Site Publishing DetailedPublishing Site
Collection
Javacript plugins
Control Template Item Template
Consuming Site Collection
Cross Site PublishingFour simple steps:1. Create content in libraries and lists in a site collection where cross-site publishing is enabled.
Enable these libraries and lists as catalogs.2. Crawl the content in your catalog-enabled libraries and lists. This will add the catalog content to
the search index.3. Add one or more Search Web Parts to the site collections where you want to display your
catalog content.4. When users view a page, the Search Web Parts issue queries to the search index. Query results
are returned from the search index, and shown in the Search Web Parts.
Site Collection Settings
Term Store
News List
Catalog Settings
Blog Comments List
Blog Comments Catalog Settings
Pub Demo Manage Catalog Connections
Content Search Web Parts
Content Search Web Part
Content Search Web Part
Build the Query
Final Query
Display Template Hierarchy
<!–# AddPostRenderCallback(ctx, function() { //code to execute });_#–>There is another way to achieve this by using:ctx.OnPostRender = function() {};
Managed Properties
Managed Properties (Search Schema)
Managed property Mapping Rules'Link URL'{Link URL}:'Path'
• first token represents the label of the property displayed in the toolpart under property mappings
• second token represents the display name of the variable reference to the actual managed metadata property. This variable will be used in the display template to access the value.
• last token is the actual name of the managed metadata that is used in display template. This is not the display name of the column but the name of the managed metadata property mapped to the crawled property in search schema.
Property Mapping in Web Part
Getting your Managed Properties
Referencing Managed Properties_#= ctx.CurrentItem.<Current item property name> =#
Var currentItemIndex = ctx.CurrentItemIdx;Var authorVal = $getItemValue(ctx, "Author");ctx.ClientControl.get_nextUniqueId();ctx.CurrentItem.ListItemIDctx.CurrentItem.SPSiteUrlCtx.CurrentGroup.RowCount
A Few References…• Bella Engen• Elio Struyf• Benjamin Niaulin• Marc Anderson
• Useful Javascript Utilities