- [Instructor] If you remember our discussion on boosting, Azure Search uses scoring functions to be able to boost data. And there are a few different ways you could do it. The first one is boosting documents matching a certain criteria. So, for example if we're selling a 24 inch monitor and the 27 inch monitor happens to be on sale, we want the 27 inch monitor to show up. And that's very, very peculiar to your business. Number two is magnitude, boosting based on a number.
It could be a rating. You know boost a particular document in the search result based on the rating of the star in that particular document. So even though it might not be the best match, but it happens to be highly rated, we want it to be boosted up. That's when you use magnitude. Number three is freshness. We want to boost a documents that were recently added. Let's take a movie database and you are going to watch a movie, and you're going to go buy your movie ticket.
It makes more sense to boost the documents based on which movies are relevant and how recently they were added compared to the movies that were out there 50 years ago. Because even though we might think that the query is exactly the same as a movie that was released 50 years ago, it might not make sense for the audience. So, that's where we use freshness. And number four is boosting based on distance.
Here's an example of the schema using scoring profiles. Scoring profiles will have the name of the scoring profile and this is a variable you can use anything you like to use. And inside text we can see we have two kinds of weights. One is the weight we added for the field county and it's two and then we added city which is five. Now, a five happens to be more. The higher the number the higher the scoring. Let's say I'm looking for county Austin and I'm looking for city Austin.
And I just do a search even though there might be a county Austin that might have a higher score than the document that has city Austin. Since we're saying city takes precedence, it will boost the results based on that particular city higher than the county. So when the results come back to us we will see the results of city Austin will take precedence over the results with county Austin. And then we can add functions inside the scoring profiles also.
Here's an example of a function. If you look at the left-hand side, we're saying this is of type magnitude which means it's based on some kind of number and we're defining that number there. We're saying boosting range starts at one and ends at five and then we're using the kind of interpolation in this case which is linear. And then we have the second one where we're saying this scoring function is based on type distance and in this case we will end up using a location and if the result from further from our location than make sure it shows up later in my searches.
Now this is an example of something where you use let's say Yelp and you want to look for a restaurant. And you want to boost the results of the restaurant that are near the person that might be in walking distance of that particular person higher than restaurants that are 20 miles away or 30 miles away. And when we search using a scoring profile, it's very simple. All we have to do is add scoring profiles equals to the name or the variable of that particular scoring profile. And then the next one uses a scoring profile that requires a parameter.
And in this case, the scoring parameter happens to be loc which is a location.
- Querying and indexing
- Creating a search service
- Using APIs during searching
- Importing JSON data
- Handling synonyms
- Working with suggestors and facets