Presentation is loading. Please wait.

Presentation is loading. Please wait.

SQLSaturday Dnipro 2016 Azure Search Anton Boyko

Similar presentations


Presentation on theme: "SQLSaturday Dnipro 2016 Azure Search Anton Boyko"— Presentation transcript:

1 SQLSaturday Dnipro 2016 Azure Search Anton Boyko aka @BoykoAnt
Microsoft Azure MVP, MCP Microsoft DevOps TE

2 Sponsors

3 #sqlsatdnipro

4 If you have any questions – interrupt and ask

5 You consider yourself a:
Web developer Mobile developer IT Pro Database engineer

6 What? A fully-managed search solution that allows developers to enable search experiences in applications. Embed a sophisticated search experience into web and mobile applications without having to worry about the complexities of full-text search and without having to deploy, maintain or manage any infrastructure.

7 Why? Users find search as a natural, low friction way to interact with applications that manage lots of data Web search engines have set the bar high for search Instant results, auto-complete, hit highlighting, great ranking, linguistics Search is hard and rarely a core expertise area From infrastructure standpoint: availability, durability, scale, operations From the functionality standpoint: ranking, geo-spatial, input handling

8 Azure Search functionality
Simple HTTP/JSON API for creating indexes, pushing documents, searching Keyword search with user-friendly operators (+, -, *, “”, etc.) Hit highlighting Faceting (histograms over ranges, typically used in catalog browsing) Suggestions (auto-complete) Rich structured queries (filter, select, sort) that combines with search Scoring profiles to model search result relevance Geo-spatial support integrated in filtering, sorting and ranking

9 Language support Arabic Armenian Bangla Basque Bulgarian Catalan Chinese Simplified Chinese Traditional Croatian Czech Danish Dutch English Estonian Finnish French Galician German Greek Gujarati Hebrew Hindi Hungarian Icelandic Indonesian (Bahasa) Irish Italian Japanese Kannada Korean Latvian Lithuanian Malayalam Malay (Latin) Marathi Norwegian Persian Polish Portuguese (Brazil) Portuguese (Portugal) Punjabi Romanian Russian Serbian (Cyrillic) Serbian (Latin) Slovak Slovenian Spanish Swedish Tamil Telugu Thai Turkish Ukrainian Urdu Vietnamese

10 Managing indexes and documents

11 Define index { "name": "hotels", "fields": [ { "name": "hotelId", "type": "Edm.String", "key": true, "searchable": false, "sortable": false, "facetable": false }, { "name": "baseRate", "type": "Edm.Double" }, { "name": "description", "type": "Edm.String", "filterable": false, "sortable": false, "facetable": false }, { "name": "description_fr", "type": "Edm.String", "filterable": false, "sortable": false, "facetable": false, "analyzer": "fr.lucene" }, { "name": "hotelName", "type": "Edm.String", "facetable": false }, { "name": "category", "type": "Edm.String" }, { "name": "tags", "type": "Collection(Edm.String)" }, { "name": "parkingIncluded", "type": "Edm.Boolean", "sortable": false }, { "name": "smokingAllowed", "type": "Edm.Boolean", "sortable": false }, { "name": "lastRenovationDate", "type": "Edm.DateTimeOffset" }, { "name": "rating", "type": "Edm.Int32" }, { "name": "location", "type": "Edm.GeographyPoint" } ] }

12 Indexing data { "value" : [ { : "upload", … }, { : "merge", … }, { : "mergeOrUpload", … }, { : "delete", … } ] }

13 Upload document { "upload", "hotelId": "1", "baseRate": 199.0, "description": "Best hotel in town", "description_fr": "Meilleur hôtel en ville", "hotelName": "Fancy Stay", "category": "Luxury", "tags": ["pool", "view", "wifi", "concierge"], "parkingIncluded": false, "smokingAllowed": false, "lastRenovationDate": " T00:00:00Z", "rating": 5, "location": { "type": "Point", "coordinates": [ , ] } }

14 Merge or upload document
{ "mergeOrUpload", "hotelId": "3", "baseRate": , "description": "Close to town hall and the river" }

15 Delete document { "delete", "hotelId": "6" }

16 Querying

17 Search GET name].search.windows.net /indexes/hotels/docs? api-version= & search=budget & $select=hotelName POST name].search.windows.net /indexes/hotels/docs/search? api-version= { "search": "budget", "select": "hotelName" }

18 Search GET name].search.windows.net /indexes/hotels/docs? api-version= & search=* & $top=2 & $orderby=lastRenovationDate%20desc & $select=hotelName,lastRenovationDate POST name].search.windows.net /indexes/hotels/docs/search?api-version= { "search": "*", "orderby": "lastRenovationDate desc", "select": "hotelName,lastRenovationDate", "top": 2 }

19 Pagination GET /indexes/hotels/docs? api-version= & search=budget & $select=hotelName & $top=15 & $skip=0 & $count=true { "values" : [ … ], : 42 }

20 Facets POST /indexes/hotels/docs/search? api-version= { "search": "test", "facets": [ "tags", "baseRate,values:80|150|220" ], "filter": "rating eq 3 and category eq 'Motel'" } { "baseRate": [ { "count": 0, "to": 80 }, { "count": 10, "from": 80, "to": 150 }, { "count": 15, "from": 150, "to": 220 }, { "count": 4, "from": 220 } ]

21 Controlling relevance

22 Controlling relevance
Relevant results Irrelevant results Returned results

23 Scoring profiles { "name": "hotels", "fields": [ … ], "scoringProfiles" : [ … ] }

24 Text weights scoring profile
{ "name": "boostName", "text": { "weights": { "hotelName": 10, "tags": 5, "description": 2, "description_fr": 2 }

25 Scoring functions - Freshness should be used when you want to boost by how new or old an item is. This function can only be used with datetime fields (edm.DataTimeOffset). Note the boostingDuration attribute is used only with the freshness function. - Magnitude should be used when you want to boost based on how high or low a numeric value is. Scenarios that call for this function include boosting by profit margin, highest price, lowest price, or a count of downloads. This function can only be used with double and integer fields. - Distance should be used when you want to boost by proximity or geographic location. This function can only be used with Edm.GeographyPoint fields. - Tag should be used when you want to boost by tags in common between documents and search queries. This function can only be used with Edm.String and Collection(Edm.String) fields.

26 Functions general properties
{ "name": "boostName", "function": { "type": "magnitude | freshness | distance | tag", "boost": # (positive number - multiplier for raw score != 1), "fieldName": "...", "interpolation": "constant | linear | quadratic | logarithmic" }

27 Freshness function { "name": "boostName", "function": { … , "freshness": { "boostingDuration": "..." (value representing timespan over which boosting occurs) }

28 Magnitude function { "name": "boostName", "function": { … , "magnitude": { "boostingRangeStart": #, "boostingRangeEnd": #, "constantBoostBeyondRange": true | false }

29 Distance function { "name": "boostName", "function": { … , "distance": { "referencePointParameter": " … ", "boostingDistance": # (the distance in kilometers from the reference location where the boosting range ends) }

30 Tags function { "name": "boostName", "function": { … , "tags": { "tagsParameter": " … " (parameter to be passed in queries to specify a list of tags to compare against target field) }

31 Scoring functions - aggregation
{ "name": "hotels", "fields": [ … ], "scoringProfiles" : [ … ], "functionAggregation": "sum | average | minimum | maximum | firstMatching" }

32 Integration

33 Azure Search data sources
SQL Server Azure SQL (aka SQL Database) Document DB Azure Blob Storage Azure Table Storage

34 Real life example

35 “Time Machine” app architecture
Command API Topic Sub Sub Query Search Worker Worker Storage

36 Resources

37 Azure Search home page https://azure. microsoft
Azure Search home page Azure Search overview on MSDN Azure Search pricing Azure Search tutorial for .NET

38 Azure Search service limits https://docs. microsoft
Azure Search service limits Azure Search scalability guidance Azure Search indexers Azure Search scoring profiles

39 Anton Boyko Microsoft Azure MVP, MCP Microsoft DevOps TE
@BoykoAnt facebook.com/boyko.ant linkedin.com/in/boykoant


Download ppt "SQLSaturday Dnipro 2016 Azure Search Anton Boyko"

Similar presentations


Ads by Google