Sie sind auf Seite 1von 43

Microsoft Official Course

Module 4

Customizing the Search Experience


Module Overview

• Customizing Query Processing


• Customizing Search Results
• Customizing Content Processing
Lesson 1: Customizing Query Processing

• Result Sources
• Creating Result Sources
• Query Transforms
• Query Transforms - Keyword Filters
• Query Transforms - Property Filters
• Query Transforms - Sorting
• Creating and Configuring Query Transforms
• Demonstration: Creating Result Sources with Query Transforms
• Query Rules
• Query Rule Conditions and Actions
• Demonstration: Query Rules
• Importing and Exporting Search Schemas
• Discussion: Result Sources and Query Rules
Result Sources

• Result Source are used to partition indexed


content into smaller meaningful sets
• Result Sources are used for Search Federation
• Exchange
• Remote SharePoint
• OpenSearch 1.0/1.1

• Each Result Source is configured with a Query


Transform
• 16 out of the box Result Sources provided
• Each provide a great example of how to build Query
Transforms
Creating Result Sources

• Result Sources can be created at any Search Schema


Level
• Service Application, Site Collection, Site
• Creation can be done via
• UI
• Windows PowerShell
• Custom .NET Applications

• Creation is handled by the FederationManager class


• Use the CreateSource method
• Must set Name and ProviderID properties

• Provider ID can be retrieved using ListProviders


method
Query Transforms

• Each Result Source must have a Query Transform


• This is simply a search query
• Used to narrow down the focus of the items in the Result
Source

• Each Query Transform has two main properties


• Query Filter – Made up of Keyword and Property Filters
• Sorting – How the final results will be sorted

• Query Transformation and Processing occurs in a


very specific order
Query Transforms - Keyword Filters

• Keyword Filters
• Used to pass values from where the query is executing
• Helpful for providing context to the Query Transform

• Query Builder tool provides a common set of


values via the UI
• Example: Pass a value from the query string

• Programmatically, you must know these values in


advance
Query Transforms - Property Filters

• Property Filters are based on Managed Properties


• Format is exactly like a user query
• PropertyName:Value

• Examples:
• FileType:docx
• ModifyDate>1/1/2013
• Author:John Doe
• ViewsLifeTime>100
Query Transforms - Sorting

• Query Transform defines the Sort order of the results


• Can be based upon
• Managed Property
• Ranking Model

• You can have multiple levels of sort


• First by Author, second by Modify Date
• Normally, Managed Properties are used to base the
sort
• Must have the Sortable property set
• Dynamic ranking can target items to move up in the results

• Ranking Profiles can provide advanced sorting


algorithms
Creating and Configuring Query Transforms

• Query Builder is an easy way to build a Query


Transforms
• Programmatically use CreateQueryTransform
method of ResultSource object
• Method contains two overrides
• (QueryTransformProperties, string)
• (string)
• QueryTransformProperties set how the query
will be sorted
• Uses a SortCollection object
• To modify a transform, get the result source and
modify the QueryTransform property
Demonstration: Creating Result Sources with
Query Transforms

• In this demonstration, you will see an example of


how to create result sources with query transforms
via the SharePoint UI.
Query Rules

• Query Rules attempt to guide a user based on


query intent

• Configuration includes
• Scope
• Conditions
• Actions
• Publishing Settings

• Replaces Keywords and Bestbets


Query Rule Conditions and Actions

• Query Rules contain conditions


• If condition evaluates to true the actions will be
processed
• Examples
• If Author = John Doe, show Amazon results
• If query contains “video”, show video results
• If query contains “401K”, show HR page as promoted
result
• Query Actions include
• Promoted Results
• Result Blocks
• Change results
Demonstration: Query Rules

• The instructor will now demonstrate how to create


and configure a query rule.
Importing and Exporting Search Schemas

• Search Schemas can be exported and imported at


the site collection and site level
• Useful for moving settings from Development into
production and as a Disaster Recovery tool
• Use the SearchConfigurationPortability class’s
ExportSearchConfiguration and
ImportSearchConfiguration
Discussion: Result Sources and Query Rules

• What types of result sources do you think you will


create and what query rules might you apply on
them?
Lesson 2: Customizing Search Results

• Search Pages and Navigation


• Search Results Web Part
• Result Types
• Display Templates
• Creating Display Templates
• Demonstration: Display Templates
• Refiners
• Creating and Configuring Refiners
• Demonstration: Creating and Configuring Refiners
• Content Search Web Part
Search Pages and Navigation

• A Search Center contains result pages


• Each result page contains search web parts with
different configurations
• Everything
• People
• Conversations
• Video
• You can customize the out of box or create your
own
• Easily done with SharePoint Designer
• Search Navigation tabs can be modified to have
your custom result pages
Search Results Web Part

• Search results web part displays search results

• Contains a Query property that defines the


content the user’s query should be executed
against

• Each results page would have a Search Results


web part with different query settings

• Typically easier to use the SharePoint UI to modify


these settings with Query Builder dialog
Result Types

• Result types are groupings of results based on a


set of conditions
• Conditions are built using managed properties
• Actions are executed based on the conditions
• Helpful for driving dynamic displaying of results
based on the metadata of a result item
• Examples
• If an item contains Latitude and Longitude, display it as a
map in the results
• If the item is a picture, show the picture in the result
Display Templates

• Display template drive how a result gets rendered


in the results
• Defines the layout how and where different
managed properties should be displayed
• Several different types of display templates
• Control, Item, Filter, Group
• Each Display template can be set to only be used
in specific search areas
Creating Display Templates

• Display templates are stored in the Master Page


Gallery
• Viewable from the gallery or the Design Manager tool
• Search Display Templates stored in Search sub-
folder
• Modify and Create files in this folder
• Use SharePoint Designer to edit or download, modify
and upload
• Use out-of-box display templates as a guide to
building your own
Demonstration: Display Templates

• In this demonstration, your instructor will show


you how to create a result type and an associated
display template.
Refiners

• Refiners allow users to drill down into search


results
• Goal: Narrow results from several thousands to a few
hundred
• A basic set of refinement properties is used by
default
• Very likely you will need to add more
• Example
• Refine by Author
• Refine by Modify Date
Creating and Configuring Refiners

• Refiners can be based off any managed property


with the active refinement property enabled
• Content must be re-crawled after enabling
• Creating a refinement property does not mean it is
automatically used
• Must add it to refinement web part
• Refinement web part will display all available
refinement properties
• Try not to have more than 10 for performance
• Create new search pages and result sources if needed

• Refinement counts are not enabled by default


• Change needed in the display template
Demonstration: Creating and Configuring
Refiners

• In this demonstration, you will see how managed


properties are configured to be refiners and how
to use them in the Refinement web part.
Content Search Web Part

• Content Search web part is a farm-wide way of


displaying specific content
• Not limited to site collection like Content Query Web
Part
• Can be configured to point at any visible result
source
• Examples:
• Provide a twitter feed based on site\list\item specific
information
• Do a search against Exchange content
• Look for highest ranked\liked items
• Look for most popular items
Lab A: Configuring Result Types and Display
Templates

• Exercise 1: Configuring and Testing a Result Type


• Exercise 2: Customizing an Item Display Template
• Exercise 3: Customizing a Hover Panel Display
Template

Logon Information
• Virtual Machine: 20489B-LON-SP-04
• User name: CONTOSO\administrator
• Password: Pa$$w0rd

Estimated Time: 75 minutes


Lab Scenario

Contoso users have found that their search results


typically include many tasks. Team leaders have
asked whether these search results can be
displayed differently to help users distinguish
between tasks and other content when they
perform a search. To meet these requirements,
you will configure a result type for the Task
content type. You will then configure display
templates to customize how matching results are
displayed.
Lesson 3: Customizing Content Processing

• Entity Extractors
• Configuring Entity Extractors
• Company Name Extractors
• Creating and Deploying a Thesaurus
• Adding Query Spelling Corrections
• Understanding Content Enrichment Web Services
• Creating a Content Enrichment Service
• Configuring Content Enrichment Service
• Discussion: Content Enrichment Service
Entity Extractors

• Entity Extractors enable you to build structured


metadata around structured and unstructured
data
• Four types of extractors
• Word
• Word Part
• Word Exact
• Word Part Exact

• Limited to 12 extractors
• Not unlimited as in FAST Search
Configuring Entity Extractors

• Entity Extractors are configured via Windows


PowerShell
• Import-
SPEnterpriseSearchCustomExtractionDictionary
• Requires a UNC path to a comma-delimited
dictionary of values
• Also requires the enumeration of the dictionary
you are uploading
Company Name Extractors

• Company entity extractor is configured via MMS


• Designed to tag content with company
information for targeted search and refinement
• Must enable the company extractor on the
managed properties
• Body and Title are preconfigured
Creating and Deploying a Thesaurus

• Acronyms are used every day, both internally and


externally
• Search engines must be taught your corporate acronyms
via Thesaurus
• Thesaurus allows for the configuration of
synonyms, for example:
• IE = Internet Explorer
• UFO = Unidentified Flying Object
• CRM = Customer Relationship Management

• Thesaurus entries are only one way; you must


define two entries for two-way
• Deployment is via Windows PowerShell
Adding Query Spelling Corrections

• Query Spelling Suggestions are helpful tools when


users mistype their queries
• You can configure both include and exclude entries
• Search results page will display a “Did you mean”
if an item is possibly misspelled
• “SharePonit” would generate a “Did you mean
SharePoint”?
• Commonly, you add exclude entries for company
products and internal names to prevent the
warning prompt
Understanding Content Enrichment Web
Services

Content
Crawl Indexing
Processing

Custom
Document Content Word
entity
Parsing Enrichment breaking
extraction
Creating a Content Enrichment Service

• To create a Content Enrichment Service


• Create a WCF Service in Visual Studio
• Add assembly reference to
Microsoft.Office.Server.Search.ContentProcessingEnri
chment.dll
• Add using statement for namespace
• Implement the IContentProcessingEnrichmentService
• Deploy the project to a server

• Deployment should be to a server that is either on


the same machine as the content processing
component or as close to it as possible on the
network
Configuring Content Enrichment Service

• SharePoint search must be configured to know where your


Content Enrichment Service has been deployed
• Utilize the New-
SPEnterpriseSearchContentEnrichmentConfiguration
cmdlet
• Settings include:
• Endpoint
• InputProperties
• OutputProperties
• SendRawData
• DebugMode
• MaxRawDataSize
• Trigger
Discussion: Content Enrichment Service

• What kind of logic might you implement in a


Content Enrichment Service?
Lab B: Configuring Entity Extraction

• Exercise 1: Creating and Deploying an Entity


Extractor

Logon Information
• Virtual Machine: 20489B-LON-SP-04
• User name: CONTOSO\administrator
• Password: Pa$$w0rd

Estimated Time: 45 minutes


Lab Scenario

As part of a rewards program, Contoso has


published a catalog of MP3 players and related
products. The catalog users have requested the
ability to sort and filter products by memory size.
To implement this request, you will create and
deploy an entity extractor and then configure a
refinement web part on the search results page.
Lab Review

• How many different types of entity extractors are


available?
• What must you do after registering the entity
extractor file?
Module Review and Takeaways

• Review Question(s)

Das könnte Ihnen auch gefallen