/
Azure Search Deep Dive Pablo Castro Azure Search Deep Dive Pablo Castro

Azure Search Deep Dive Pablo Castro - PowerPoint Presentation

tatyana-admore
tatyana-admore . @tatyana-admore
Follow
374 views
Uploaded On 2019-02-03

Azure Search Deep Dive Pablo Castro - PPT Presentation

DBIB410 When you need to find something Search the Web Search in an App Azure Search A searchasaservice solution allowing developers to incorporate great search experiences into applications without managing infrastructure or needing to become search experts ID: 749767

api search docs amp search api amp docs microsoft index data scoring documents type indexes windows ridge filter version

Share:

Link:

Embed:

Download Presentation from below link

Download Presentation The PPT/PDF document "Azure Search Deep Dive Pablo Castro" is the property of its rightful owner. Permission is granted to download and print the materials on this web site for personal, non-commercial use only, and to display it on your personal computer provided you do not modify the materials and that you retain all copyright notices contained in the materials. By downloading content from our website, you accept the terms of this agreement.


Presentation Transcript

Slide1
Slide2

Azure Search Deep Dive

Pablo Castro

DBI-B410Slide3

When you need to find something…

Search the Web

Search in an AppSlide4

Azure Search

A search-as-a-service solution allowing developers to incorporate great search experiences into applications without managing infrastructure or needing to become search experts.Slide5

Scenarios

If

an

app

offers

lots of content your users will be more effective searching instead of

browsingOnline retail, ecommerce

User-generated content, social content

Line-of-business applicationsSlide6

Using Azure Search

Provision service

Create index

Index

data

Search

Tune

resultsSlide7

1. Provisioning Search ServicesSlide8

“Search Service”

Scope of capacity, billing, authentication

Managed through the portal or management API

May have one or more indexes

Service name -> API root URL

e.g

. https://mysvc.search.windows.netSlide9

API: List Indexes in a Search Service

GET /

indexes?api-version

=2014-07-31-Preview

Host: demo.search.windows.net

api

-key:

91FAB1CDBD75CF1D39491043BF3491ACSlide10

2. Defining IndexesSlide11

A searchable collection of documents

Has a schema

Has various options, e.g. scoring profiles, CORS

Index name -> API URL:

e.g. https

://

mysvc.search.windows.net/indexes/myindex

“Search Index”Slide12

List of fields and their configuration

Data types: string,

int

, double,

datetime

,

boolean, geo-point

Single valued or collectionsFor each field, whether it can be used for…

SearchSuggestions

FiltersIndex Schema

Sorting

Facets

ResultsSlide13

API: Create an Index

PUT /indexes/

places?api-version

=2014-07-31-Preview

Host

: demo.search.windows.net

api

-key

: 91FAB1CDBD75CF1D39491043BF3491ACContent-Type: application/json

{ "fields":

[

{ "name":

"key",

"type": "

Edm.String

",

"key": true

},

{ "name": "name", "type": "

Edm.String", "

facetable": false }, { "name": "class", "type": "Edm.String" }, ... ],

"corsOptions": { "allowedOrigins": ["*"] }}Slide14

3

. Indexing DataSlide15

Data is indexed in batches

Up to 1000 operations: upload, merge, delete or

mergeOrUpload

POST to https://

mysvc.search.windows.net/indexes/myindex/docs/index

A success response ensures durability

Client needs to check response body for individual operation status

Data will be searchable a few seconds later

We need to index it, depends on how busy the system is

Indexing DataSlide16

API: Batch to Upload Documents

POST indexes/places/docs/

index?api-version

=2014-07-31-Preview

Host

: demo.search.windows.net

api

-key: 91FAB1CDBD75CF1D39491043BF3491AC

Content-Type: application/json

{ "value": [

{

"@

search.action

": "upload",

"key": "1502914",

"name": "Penny Creek",

"

class": "Stream

",

... }, ...] }Slide17

4. SearchingSlide18

Scope for search is an index

The search API offers a number of options

Full-text search including user-friendly operators

Query support: strict filters, sorting, paging and field selection

Faceting

Hit highlighting

Results include scores plus requested fields

Can be used to render results without hitting primary store

SearchingSlide19

API: Search

(

All HTTP GET requests with version parameter)

Simple search:

…/

docs?search

=my search text

Search combined with a strict filter:

…/

docs?search

=ridge&$filter=class eq

'Trail'

Search with sorting, paging, field selection:

…/

docs?search

=ridge&$

orderby

=rating

desc

&$top=5&$select=name,class,ratingFaceting:…/

docs?search=ridge&facet=rating&facet=countyHit

highlighting:…/docs?search=ridge&highlight=nameSlide20

API: Search + Geospatial

(

All HTTP GET requests with version parameter)

Search in documents within 5 KM of my location:

…/

docs?search

=trail&$filter=

geo.distance

(

loc,'POINT(-127.21 42)') lt

5

Sort results by distance from my location:

…/

docs?search

=trail

&$

orderby

=

geo.distance

(

loc,geography'POINT(-127.21 42)')Search for documents within a given polygon:

…/docs?search=trail&$filter=geo.intersects(loc, geography'POLYGON((-122.031577 47.578581, -122.031577 47.678581, -122.131577 47.678581, -122.031577 47.578581

))')Slide21

Building block for auto-complete

Partial search text -> list of suggestions

Tricky balance of speed and features

Executes as you type

Suggestions come from document data

Option needs to be enabled in index definition

Search SuggestionsSlide22

API: Suggestions

(All HTTP GET requests with version parameter)

Simple

suggestions:

…/docs/

suggest?search

=

ridg

Combined

with a strict filter:

…/docs/

suggest?search

=

ridg

&$

filter=class

eq

'Trail'

With

sorting, paging, field selection:…/docs/suggest?search=ridg&$orderby

=rating desc&$top=5&$select=name,classSlide23

5. TuningSlide24

Default: scoring based on text relevance

Scoring profiles for tuning scores

Field weights: relative importance of fields

Scoring functions: describe what matters to you

One or more scoring profiles for different scenarios

Connecting Ranking to App GoalsSlide25

Tune score based on document data

Boost documents matching certain criteria

Different interpolation curves

Magnitude

A number

,

e.g.

rating,

popularity or profit marginFreshnessBoost documents based on how recent they are

DistanceBoost documents based on distanceScoring FunctionsSlide26

Index definition: Field Weights

{

"fields":

[ … ], "

corsOptions

":

{ … },

"

scoringProfiles": [

{ "name": "myProfile",

"text": {

"weights":

{

"

county":

2,

“class”: 2

} }, "functions": [ … ] } ]

}Slide27

Index definition: Scoring Functions

{

"type": "magnitude",

"boost": 2,

"

fieldName": "rating", "interpolation": "linear",

"magnitude": { "

boostingRangeStart": 1,

"

boostingRangeEnd

": 5

}

}

{

"type

": "distance",

"boost

": 3,

"fieldName": "location", "interpolation": "quadratic", "distance": {

"

referencePointParameter

": "

loc

",

"

boostingDistance

": 50

}

}Slide28

API: Search with Scoring Profiles

Use a scoring profile:

…/

docs?search

=

ridge?scoringProfile

=

myProfile

Use a scoring

profile that requires parameters:

…/

docs?search

=

ridge&scoringProfile

=

myProfile&scoringParameter

=loc:47.2,-122Slide29

Provisioning and ScalingSlide30

Public Preview Options

4 regions

West US, East US, North Europe, Southeast

Asia

More regions coming soon

Partitions

(more documents, more storage)

Replicas

(more queries, more HA)

SKU

Price

per search unit/month*

Docs

Queries/sec

Free

-

10K

-

Standard

~$125

(~

€ 94)

15M

~15

“Contact

us”

~$500 (~€ 376)

60M

~50

We’re still fine-tuning the limits above

* Billed hourly

* Prices reflect 50% discount for public previewSlide31

Sessions

FDN04 The Microsoft Data Platform Evolution

Find me later at…

Microsoft Solutions Experience Location

Ask The Experts tonight

Content on the Web

Forums

https://social.msdn.microsoft.com/forums/azure/en-US/home?forum=azuresearch

Related contentSlide32

27 Hands on Labs + 8 Instructor Led Labs in Hall 7

DBI Track resources

Free SQL Server 2014 Technical Overview e-book

microsoft.com/sqlserver

and

Amazon Kindle Store

Free online training at Microsoft Virtual Academy

microsoftvirtualacademy.com

Try new Azure data services previews!

Azure Machine Learning

,

DocumentDB

, and

Stream Analytics Slide33

Resources

Learning

Microsoft Certification & Training Resources

www.microsoft.com/learning

Developer Network

http

://developer.microsoft.com

TechNet

Resources for IT Professionals

http://microsoft.com/technet

Sessions on Demand

http://channel9.msdn.com/Events/TechEdSlide34

Please Complete An Evaluation Form

Your input is important!

TechEd Schedule Builder

CommNet

station

or PC

TechEd Mobile

app

Phone or Tablet

QR codeSlide35

Evaluate this sessionSlide36

© 2014 Microsoft Corporation. All rights reserved. Microsoft, Windows, and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries.

The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.