spca2014 search queries explained svenson

21

Upload: nccomms

Post on 02-Jul-2015

179 views

Category:

Documents


1 download

TRANSCRIPT

Page 1: Spca2014 search queries explained svenson
Page 2: Spca2014 search queries explained svenson

Search Queries Explained

Mikael Svenson – Principal Consultant

@mikaelsvenson – [email protected] – techmikael.blogspot.com

Page 3: Spca2014 search queries explained svenson

Dev by day – Super Hero by Night

with great power comes great responsibility

Page 4: Spca2014 search queries explained svenson

I will not cover

• Managed property weights

• Full-text indexes in detail

• Custom rank profiles

• Graph Query Language (GQL v1)

Page 5: Spca2014 search queries explained svenson

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

Page 6: Spca2014 search queries explained svenson

Overview

Web PartResult Source

(Scope)

Result Type Item TemplateControl

Template

Search Index

Search Result Web Part

CSWP is hard set

Page 7: Spca2014 search queries explained svenson

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) ArticleStartDateOWSDATEuse Date00 / RefinableDate00

Page 8: Spca2014 search queries explained svenson

What makes a SharePoint column/field searchable?

Managed Property Crawled Property

Page 9: Spca2014 search queries explained svenson

What makes a SharePoint column/field searchable?

Crawled Property Managed PropertyIncluded in

Full text-indexNot included inFull text-index Searchable

NotSearchable

ColumnSearchable

x ✓

x ✗

x x ✓

x x ✓

x x ✗

x x ✗

Page 10: Spca2014 search queries explained svenson

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

Page 11: Spca2014 search queries explained svenson

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"

Page 12: Spca2014 search queries explained svenson

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

Page 13: Spca2014 search queries explained svenson

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

Page 14: Spca2014 search queries explained svenson

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

Page 15: Spca2014 search queries explained svenson

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

Page 16: Spca2014 search queries explained svenson

Query Rules

• Triggering

• Rewrite

• Reorder – only one

• Groups with stop/continue

• Result Blocks

Page 17: Spca2014 search queries explained svenson

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

Page 18: Spca2014 search queries explained svenson

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

Page 19: Spca2014 search queries explained svenson

Turning Business Rules into Query Rules

It’s all about..

Page 20: Spca2014 search queries explained svenson
Page 21: Spca2014 search queries explained svenson

Q & A