+ All Categories
Home > Documents > Microsoft ® Official Course Interacting with the Search Service Microsoft SharePoint 2013...

Microsoft ® Official Course Interacting with the Search Service Microsoft SharePoint 2013...

Date post: 21-Dec-2015
Category:
Upload: angel-garrett
View: 218 times
Download: 1 times
Share this document with a friend
Popular Tags:
30
Microsoft ® Official Course Interacting with the Search Service Microsoft SharePoint 2013 SharePoint Practice
Transcript
Page 1: Microsoft ® Official Course Interacting with the Search Service Microsoft SharePoint 2013 SharePoint Practice.

Microsoft® Official Course

Interacting with the Search Service

Microsoft SharePoint 2013

SharePoint Practice

Page 2: Microsoft ® Official Course Interacting with the Search Service Microsoft SharePoint 2013 SharePoint Practice.

Module Overview

Understanding the SharePoint 2013 Search Service

Building Search Queries with KQL and FQL•Executing Search Queries from Code

Page 3: Microsoft ® Official Course Interacting with the Search Service Microsoft SharePoint 2013 SharePoint Practice.

Lesson 1: Understanding the SharePoint 2013 Search Service

Search Architecture

Demonstration: Exploring the Search Architecture

The Search Index

Crawled Properties

Managed Properties

Demonstration: Exploring Crawl and Managed Properties

Search Schema•Demonstration: Exploring the Search Schema

Page 4: Microsoft ® Official Course Interacting with the Search Service Microsoft SharePoint 2013 SharePoint Practice.

Search Architecture

•SharePoint Architecture has six roles• Administration• Crawling• Content Processing• Analytics Processing• Query Processing• Index

•Core services are run in following processes• NodeRunner.exe• HostControllerService.exe• Mssmdm.exe

Page 5: Microsoft ® Official Course Interacting with the Search Service Microsoft SharePoint 2013 SharePoint Practice.

Demonstration: Exploring the Search Architecture

• In this demonstration your instructor will demonstrate the Search Architecture and the search index

Page 6: Microsoft ® Official Course Interacting with the Search Service Microsoft SharePoint 2013 SharePoint Practice.

The Search Index

•Search index resides on the file system•Broken into partitions for improved performance• Default• Security• Link• Usage• People

•Redundancy provided by creating index partitions and replicas• Similar to columns and rows in FAST Search

Page 7: Microsoft ® Official Course Interacting with the Search Service Microsoft SharePoint 2013 SharePoint Practice.

Crawled Properties

•Crawl property is data about an item from its content source or within the item•Example:• A metadata column in a list (source)• The createdate from the filesystem (source)• The title from a word document (item)

•Crawl properties are retrieved from the crawler and the content processing components•Crawl properties are grouped into categories

Page 8: Microsoft ® Official Course Interacting with the Search Service Microsoft SharePoint 2013 SharePoint Practice.

Managed Properties

•Managed properties are single or aggregated crawl properties that are configured for specific search purposes• Mapped order matters for single value properties

•Only managed properties are included in search index•Example:• Crawl property name is not user friendly• Multiple crawl properties from different sources need to be mapped to same managed property• Can be used as a refiner• Can be searchable

Page 9: Microsoft ® Official Course Interacting with the Search Service Microsoft SharePoint 2013 SharePoint Practice.

Demonstration: Exploring Crawl and Managed Properties

• In this demonstration your instructor will explore crawled and managed properties

Page 10: Microsoft ® Official Course Interacting with the Search Service Microsoft SharePoint 2013 SharePoint Practice.

Search Schema

•SharePoint Search Schema defines several search configuration specific details• Result Sources• Result Types• Managed Properties

•2013 Search Schema is multi-leveled• Service Application• Site Collection• Site

•Allows customizations that are appropriate for each level’s use cases

Page 11: Microsoft ® Official Course Interacting with the Search Service Microsoft SharePoint 2013 SharePoint Practice.

Demonstration: Exploring the Search Schema

Page 12: Microsoft ® Official Course Interacting with the Search Service Microsoft SharePoint 2013 SharePoint Practice.

Lesson 2: Building Search Queries with KQL and FQL

SharePoint Query Languages

Keyword Query Language (KQL) Queries

KQL Operators

Advanced KQL• FAST Query Language (FQL) Queries

Page 13: Microsoft ® Official Course Interacting with the Search Service Microsoft SharePoint 2013 SharePoint Practice.

SharePoint Query Languages

•SharePoint supports two types of query languages• Keyword Query Language (KQL)• FAST Query Language (FQL)

•KQL is the default query language• FQL must be enabled manually

•SQL Syntax (FullTextSqlQuery) queries no longer supported• Any older applications will break when moving to SharePoint 2013

Page 14: Microsoft ® Official Course Interacting with the Search Service Microsoft SharePoint 2013 SharePoint Practice.

Keyword Query Language (KQL) Queries

•KQL queries can be up to 2048 characters• Programmatically you can increase this limit

•Simple keyword queries are run against the full text index• They are not case sensitive• Includes any crawled property with the Include in full-text index checked

•Phrases are designated with double quotes (“SharePoint”)

Page 15: Microsoft ® Official Course Interacting with the Search Service Microsoft SharePoint 2013 SharePoint Practice.

KQL Operators

• KQL allows the use of various operators to allow advanced query capabilities• Queries with no operator specified are implicitly AND operators• Available operators include• Wildcard• Comparison (<,>,<=,>=,<>)• Contains (:)• Proximity (NEAR, ONEAR)• Ranking (XRANK)• Synonym (WORDS)

• All operators are case sensitive and must be in uppercase

Page 16: Microsoft ® Official Course Interacting with the Search Service Microsoft SharePoint 2013 SharePoint Practice.

Advanced KQL

•Simple keyword searches tend to present two common issues• Never any results• Too many results

•Advanced queries resolve this

Page 17: Microsoft ® Official Course Interacting with the Search Service Microsoft SharePoint 2013 SharePoint Practice.

FAST Query Language (FQL) Queries

• FAST Query Language (FQL) is a developer’s search query language• Originally part of FAST Search engine• Syntax has changed slightly from 2010

•Disabled by default, must be enabled in code and on a result source• Use KeywordQuery.EnableFQL property

•Three main elements• Token expressions• Property specification• Operators

Page 18: Microsoft ® Official Course Interacting with the Search Service Microsoft SharePoint 2013 SharePoint Practice.

Lesson 3: Executing Search Queries from Code

Search APIs

Executing Web Service Queries

Executing Server-Side Queries

Demonstration: Server Side Object Model

Executing Client Side Queries

Demonstration: Client Side Object Model

Executing Representational state transfer (REST) Queries•Demonstration: Executing FQL Queries

Page 19: Microsoft ® Official Course Interacting with the Search Service Microsoft SharePoint 2013 SharePoint Practice.

Search APIs

•There are several ways to submit a query to SharePoint Search• User Interface (UI)• Web Services• Server Object Model• Client Side Object Model• REST

•Based on industry standards• Web services, HTTP, REST, .NET• Easily integrate search into legacy applications

Page 20: Microsoft ® Official Course Interacting with the Search Service Microsoft SharePoint 2013 SharePoint Practice.

Executing Web Service Queries

•Web Services are deprecated in 2013• Still work, but you should migrate to different API

•Uses the /_vti_bin/spsearch.asmx end point•Query and QueryEx methods require a specially xml formatted query parameter

Page 21: Microsoft ® Official Course Interacting with the Search Service Microsoft SharePoint 2013 SharePoint Practice.

Executing Server-Side Queries

•Server side object model must be run on a SharePoint server• Must be run in x64 application

•Use KeywordQuery class to build queries• Execute method is deprecated• Use new SearchExecutor class to execute single and multiple queries

Page 22: Microsoft ® Official Course Interacting with the Search Service Microsoft SharePoint 2013 SharePoint Practice.

Demonstration: Server Side Object Model

• In this demonstration your instructor will demonstrate how to make search server side object model calls

Page 23: Microsoft ® Official Course Interacting with the Search Service Microsoft SharePoint 2013 SharePoint Practice.

Executing Client Side Queries

•Client side object model is a .NET API that can run from any .NET client• App does not have to run on SharePoint server

•Calls are proxied to the server side object model•Similar to Server Side, use the KeywordQuery class to construct queries• SearchExecutor class is also used to send multiple queries at once• Results are returned in a ResultTableCollection• Iterate through all ResultTable objects to get the full result set (Promoted Results, Main Results)

•QueryAsUserIgnoreAppPrincipal permission scope

Page 24: Microsoft ® Official Course Interacting with the Search Service Microsoft SharePoint 2013 SharePoint Practice.

Demonstration: Client Side Object Model

• In this demonstration your instructor will show you how to make client-side service object model

Page 25: Microsoft ® Official Course Interacting with the Search Service Microsoft SharePoint 2013 SharePoint Practice.

Executing Representational state transfer (REST) Queries

•Representation state transfer (REST) is a simple HTTP based protocol• GET, POST, MERGE

•REST Search requests utilizes the http://server/_api/search/query end point• Result format can be in XML or JSON• Based on Accept header

• Application/atom+xml• Application/json

•REST Query Suggestions requests utilize the http://server/_api/search/suggest end point• Helpful for autocomplete controls

Page 26: Microsoft ® Official Course Interacting with the Search Service Microsoft SharePoint 2013 SharePoint Practice.

Demonstration: Executing FQL Queries

• In this demonstration your instructor will demonstrate how to execute FAST Query Language (FQL) queries

Page 27: Microsoft ® Official Course Interacting with the Search Service Microsoft SharePoint 2013 SharePoint Practice.

Lab: Executing Search Queries from SharePoint Apps

Exercise 1: Submitting Search Queries from Client-Side Code•Exercise 2: Using a Custom Action to Launch A Search App

Page 28: Microsoft ® Official Course Interacting with the Search Service Microsoft SharePoint 2013 SharePoint Practice.

Lab Scenario

The management team at Contoso is concerned about the proliferation of duplicate content across the new intranet portal. The team wants to provide a way for users to check, given a particular document, whether similar content exists elsewhere on the portal. To implement this functionality, you will create an app that uses client-side search APIs to query the search index for similar content. In addition to using the client applications, they would also like to be able to find items based on metadata but without having to type the queries. They would like you to add a custom action to the menu items to redirect to the

Page 29: Microsoft ® Official Course Interacting with the Search Service Microsoft SharePoint 2013 SharePoint Practice.

Lab Scenario

• client app.

Page 30: Microsoft ® Official Course Interacting with the Search Service Microsoft SharePoint 2013 SharePoint Practice.

Module Review and Takeaways


Recommended