This document provides an overview of search queries in SharePoint, including:
- Crawled and managed properties which make columns searchable
- Keyword Query Language (KQL) and FAST Query Language (FQL) for constructing queries
- Result sources for defining the scope of searches
- Query rules for rewriting and reordering query results
- Using the Content Search web part for search result orchestration across a page
BDSM⚡Call Girls in Sector 97 Noida Escorts >༒8448380779 Escort Service
Search Queries Explained – A Deep Dive into Query Rules, Query Variables and Search Orchestration
1.
2. Search Queries Explained
Mikael Svenson – Principal Consultant
@mikaelsvenson – mikael.svenson@puzzlepart.com – techmikael.blogspot.com
3. Dev by day – Super Hero by Night
with great power comes great responsibility
4. I will not cover
• Managed property weights
• Full-text indexes in detail
• Custom rank profiles
• Graph Query Language (GQL v1)
5. I will cover
• Overview of components involved in a search page
• Crawled and Managed Properties
• Keyword Query Language (KQL)
• FAST Query Language (FQL)
• Result Sources
• Query Variables
• Query Rules
• Orchestration using Content Search Web Part
6. Overview
Web Part
Result Source
(Scope)
Result Type Item Template
Control
Template
Search Index
Search Result Web Part
CSWP is hard set
7. Crawled and Managed Properties
Column Internal Name Title
Crawled Property ows_Title
Managed Property Title
Column Internal Name (taxonomy) MyLocation
Crawled Property ows_MyLocation, ows_taxId_MyLocation
Managed Property owstaxidMyLocation
Column Internal Name (date) ArticleStartDate
Crawled Property ows_ArticleStartDate, ows_q_DATE_ArticleStartDate
Managed Property (type text) ArticleStartDateOWSDATE
use Date00 / RefinableDate00
8. What makes a SharePoint column/field
searchable?
Managed Property Crawled Property
9. What makes a SharePoint column/field
searchable?
Crawled Property Managed Property
Included in
Full text-index
Not included in
Full text-index Searchable
Not
Searchable
Column
Searchable
x ✓
x ✗
x x ✓
x x ✓
x x ✗
x x ✗
10. KQL - Demo
contoso
contoso marketing
contoso OR marketing
((contoso OR marketing) OR
(sales)) NOT bistro
author:julian
author:julian author:garth
author:julian AND author:garth
author:garth title:sales
size:50..100
write:“this week"
write:"last month"
contoso NEAR(2) marketing
contoso ONEAR(3) marketing
marketing ONEAR(3) contoso
contoso XRANK(cb=10) marketing
11. KQL - Demo
GP0|#<guid> All items tagged with term
GPP|#<guid> All child items of term, but not the term
GTSet|#<guid> All terms in term set
All Departments
owstaxIdDeptTaxonomy:"GTSet|#8ed8c9ea-7052-4c1d-a4d7-b9c10bffea6f"
Engineering (only have one level)
owstaxIdDeptTaxonomy:"GP0|#c7284168-2c56-460c-bb37-743a62b4ba57"
12. FQL – It’s all really FQL
• More operators
• starts-with
• ends-width
• filter
• .. http://msdn.microsoft.com/en-us/library/office/ff394606(v=office.15).aspx
• Perhaps not for human input
• Refinement filters by default are FQL – ranking will be different
13. FQL Demo – It’s all really FQL
• KQL: contoso marketing
• FQL: and("contoso", "marketing")
• KQL: ((contoso OR marketing) OR (sales)) NOT bistro
• FQL: andnot(or(or("contoso", "marketing"), "sales"),"bistro")
• FQL: title:starts-with("knowledge")
• Perhaps not for human input
• Refinement filters by default are FQL – ranking will be different
14. Result Sources
• Think of them as 2010 scopes with sorting powers
• What should be included or omitted?
• SSA, Tenant, Site Collection, Site Levels
• GUIDs change on import for SearchConfig export/import
15. Query Variables – web part on page to filter
page tag against people
• {?} notation – exclude if empty
• {} notation – don’t add quotes
• {|} notation – multi-value expansion
• User
• Page
• QueryString
• Custom ones – inject in page or webpart
• User segments -> query rules
16. Query Rules
• Triggering
• Rewrite
• Reorder – only one
• Groups with stop/continue
• Result Blocks
17. Search Orchestration
• Create seven result sources (two for triggering)
• Create two query rules – above and below the fold
• Add result blocks per rule
• Edit page, reconfigure CSWP to use above sources
• Use async for the below the fold web parts
18. Summary
• You are the conductor!
• You are responsible for making the connections between
• Column -> cp -> mp -> result source -> query rule -> web part
• Result type -> display template -> web part
Site columns get’s automatic managed properties of type text
Queryable
Retrievable
Reusable ones
Int00
Date00
Double00
Decimnal00
RefinableInt
RefinableDate
RefinableDouble
RefinableDecimal
RefinableString
Taking two of the queries we have already tested to rewrite in FQL
I have created an FQL enabled result source for the demo and added the guid to the dropdown in the tool
Taking two of the queries we have already tested to rewrite in FQL
I have created an FQL enabled result source for the demo and added the guid to the dropdown in the tool
I’ll try the count query, but might just time out as it’s a heavy one
I talked about result source for FQL – so let’s take a look