1 / 30

Interacting with the Search Service

Microsoft SharePoint 2013. Interacting with the Search Service . SharePoint Practice. Module Overview. Understanding the SharePoint 2013 Search Service Building Search Queries with KQL and FQL Executing Search Queries from Code. Lesson 1: Understanding the SharePoint 2013 Search Service.

misu
Download Presentation

Interacting with the Search Service

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Microsoft SharePoint 2013 Interacting with the Search Service SharePoint Practice

  2. Module Overview • Understanding the SharePoint 2013 Search Service Building Search Queries with KQL and FQL Executing Search Queries from Code

  3. 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

  4. 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

  5. Demonstration: Exploring the Search Architecture • In this demonstration your instructor will demonstrate the Search Architecture and the search index

  6. 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

  7. 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

  8. 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

  9. Demonstration: Exploring Crawl and Managed Properties • In this demonstration your instructor will explore crawled and managed properties

  10. 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

  11. Demonstration: Exploring the Search Schema

  12. 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

  13. 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

  14. 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”)

  15. 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

  16. Advanced KQL • Simple keyword searches tend to present two common issues • Never any results • Too many results • Advanced queries resolve this

  17. 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

  18. 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

  19. 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

  20. 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

  21. 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

  22. Demonstration: Server Side Object Model • In this demonstration your instructor will demonstrate how to make search server side object model calls

  23. 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

  24. Demonstration: Client Side Object Model • In this demonstration your instructor will show you how to make client-side service object model

  25. 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

  26. Demonstration: Executing FQL Queries • In this demonstration your instructor will demonstrate how to execute FAST Query Language (FQL) queries

  27. 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

  28. 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

  29. Lab Scenario • client app.

  30. Module Review and Takeaways

More Related