Skip to content

Commit 36eb40d

Browse files
Merge pull request #464 from HeidiSteen/heidist-scoring
misc update, adding links
2 parents 4d196f9 + 7541536 commit 36eb40d

File tree

3 files changed

+13
-11
lines changed

3 files changed

+13
-11
lines changed

articles/search/index-add-scoring-profiles.md

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ POST /indexes/hotels/docs&api-version=2024-07-01
8585

8686
This query searches on the term "inn" and passes in the current location. Notice that this query includes other parameters, such as scoringParameter. Query parameters, including "scoringParameter", are described in [Search Documents (REST API)](/rest/api/searchservice/documents/search-post).
8787

88-
See the [Extended example](#extended-example) to review a more detailed example of a scoring profile.
88+
See the [Extended example for vector and hybrid search](#extended-example-for-vector-and-hybrid-search) and [Extended example for keyword search](#extended-example-for-keyword-search) for more scenarios.
8989

9090
## How search scoring works in Azure AI Search
9191

@@ -95,8 +95,6 @@ When you use scoring profiles or any other boosting features in Azure AI Search,
9595

9696
:::image type="content" source="media/scoring-profiles/scoring-over-ranked-results.png" alt-text="Diagram showing which fields have a scoring profile and when ranking occurs.":::
9797

98-
For text queries, weight is always `1.0`. For vector queries, weight is a decimal. For example, if you have two vector queries, one weight could be `0.5` while the other could be `2.0`.
99-
10098
> [!TIP]
10199
> You can use the [featuresMode (preview)](index-similarity-and-scoring.md#featuresmode-parameter-preview) parameter to request extra scoring details with the search results (including the field level scores).
102100
@@ -108,17 +106,17 @@ For text queries, weight is always `1.0`. For vector queries, weight is a decima
108106

109107
1. Provide a name that adheres to [naming conventions](/rest/api/searchservice/naming-rules).
110108

111-
1. Specify boosting criteria. A single profile can contain [weighted fields](#use-weighted-fields), [functions](#use-functions), or both.
109+
1. Specify boosting criteria. A single profile can contain [text weighted fields](#use-text-weighted-fields), [functions](#use-functions), or both.
112110

113111
You should work iteratively, using a data set that will help you prove or disprove the efficacy of a given profile.
114112

115113
Scoring profiles can be defined in Azure portal as shown in the following screenshot, or programmatically through [REST APIs](/rest/api/searchservice/indexes/create-or-update) or in Azure SDKs, such as the [ScoringProfile](/dotnet/api/azure.search.documents.indexes.models.scoringprofile) class in the Azure SDK for .NET.
116114

117115
:::image type="content" source="media/scoring-profiles/portal-add-scoring-profile-small.png" alt-text="Add scoring profiles page" lightbox="media/scoring-profiles/portal-add-scoring-profile.png" border="true":::
118116

119-
## Use weighted fields
117+
## Use text-weighted fields
120118

121-
Use weighted fields when field context is important and queries include `searchable` string fields. For example, if a query includes the term "airport", you might want "airport" in the Description field to have more weight than in the HotelName.
119+
Use text-weighted fields when field context is important and queries include `searchable` string fields. For example, if a query includes the term "airport", you might want "airport" in the Description field to have more weight than in the HotelName.
122120

123121
Weighted fields are name-value pairs composed of a `searchable` field and a positive number that is used as a multiplier. If the original field score of HotelName is 3, the boosted score for that field becomes 6, contributing to a higher overall score for the parent document itself.
124122

@@ -237,7 +235,11 @@ The following table provides several examples.
237235

238236
For more examples, see [XML Schema: Datatypes (W3.org web site)](https://www.w3.org/TR/xmlschema11-2/#dayTimeDuration).
239237

240-
## Extended example
238+
## Extended example for vector and hybrid search
239+
240+
See this [blog post](https://farzzy.hashnode.dev/enhance-azure-ai-search-document-boosting) and [notebook](https://github.com/farzad528/azure-ai-search-python-playground/blob/main/azure-ai-search-document-boosting.ipynb) for a demonstration of using scoring profiles and document boosting in vector and generative AI scenarios.
241+
242+
## Extended example for keyword search
241243

242244
The following example shows the schema of an index with two scoring profiles (`boostGenre`, `newAndHighlyRated`). Any query against this index that includes either profile as a query parameter will use the profile to score the result set.
243245

articles/search/query-lucene-syntax.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ Proximity searches are used to find terms that are near each other in a document
130130

131131
Term boosting refers to ranking a document higher if it contains the boosted term, relative to documents that don't contain the term. This differs from scoring profiles in that scoring profiles boost certain fields, rather than specific terms.
132132

133-
The following example helps illustrate the differences. Suppose that there's a scoring profile that boosts matches in a certain field, say *genre* in the [musicstoreindex example](index-add-scoring-profiles.md#extended-example). Term boosting could be used to further boost certain search terms higher than others. For example, `rock^2 electronic` boosts documents that contain the search terms in the genre field higher than other searchable fields in the index. Further, documents that contain the search term *rock* are ranked higher than the other search term *electronic* as a result of the term boost value (2).
133+
The following example helps illustrate the differences. Suppose that there's a scoring profile that boosts matches in a certain field, say *genre* in the [musicstoreindex example](index-add-scoring-profiles.md#extended-example-for-keyword-search). Term boosting could be used to further boost certain search terms higher than others. For example, `rock^2 electronic` boosts documents that contain the search terms in the genre field higher than other searchable fields in the index. Further, documents that contain the search term *rock* are ranked higher than the other search term *electronic* as a result of the term boost value (2).
134134

135135
To boost a term, use the caret, `^`, symbol with a boost factor (a number) at the end of the term you're searching. You can also boost phrases. The higher the boost factor, the more relevant the term is relative to other search terms. By default, the boost factor is 1. Although the boost factor must be positive, it can be less than 1 (for example, 0.20).
136136

articles/search/vector-search-how-to-query.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ ms.service: cognitive-search
99
ms.custom:
1010
- build-2024
1111
ms.topic: how-to
12-
ms.date: 08/19/2024
12+
ms.date: 09/24/2024
1313
---
1414

1515
# Create a vector query in Azure AI Search
@@ -463,8 +463,6 @@ Weights are used when calculating the [reciprocal rank fusion](hybrid-search-ran
463463

464464
The following example is a hybrid query with two vector query strings and one text string. Weights are assigned to the vector queries. The first query is 0.5 or half the weight, reducing its importance in the request. The second vector query is twice as important.
465465

466-
Text queries have no weight parameters, but you can increase or decrease their importance by setting [maxTextRecallSize](hybrid-search-how-to-query.md#set-maxtextrecallsize-and-countandfacetmode-preview).
467-
468466
```http
469467
POST https://[service-name].search.windows.net/indexes/[index-name]/docs/search?api-version=2024-07-01
470468
@@ -489,6 +487,8 @@ POST https://[service-name].search.windows.net/indexes/[index-name]/docs/search?
489487
}
490488
```
491489

490+
Vector weighting applies to vectors only. The text query in this example ("hello world") has an implicit weight of 1.0 or neutral weight. However, in a hybrid query, you can increase or decrease the importance of text fields by setting [maxTextRecallSize](hybrid-search-how-to-query.md#set-maxtextrecallsize-and-countandfacetmode-preview).
491+
492492
## Set thresholds to exclude low-scoring results (preview)
493493

494494
Because nearest neighbor search always returns the requested `k` neighbors, it's possible to get multiple low scoring matches as part of meeting the `k` number requirement on search results. To exclude low-scoring search result, you can add a `threshold` query parameter that filters out results based on a minimum score. Filtering occurs before [fusing results](hybrid-search-ranking.md) from different recall sets.

0 commit comments

Comments
 (0)