You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: articles/search/index-add-scoring-profiles.md
+9-7Lines changed: 9 additions & 7 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -85,7 +85,7 @@ POST /indexes/hotels/docs&api-version=2024-07-01
85
85
86
86
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).
87
87
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.
89
89
90
90
## How search scoring works in Azure AI Search
91
91
@@ -95,8 +95,6 @@ When you use scoring profiles or any other boosting features in Azure AI Search,
95
95
96
96
:::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.":::
97
97
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
-
100
98
> [!TIP]
101
99
> 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).
102
100
@@ -108,17 +106,17 @@ For text queries, weight is always `1.0`. For vector queries, weight is a decima
108
106
109
107
1. Provide a name that adheres to [naming conventions](/rest/api/searchservice/naming-rules).
110
108
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.
112
110
113
111
You should work iteratively, using a data set that will help you prove or disprove the efficacy of a given profile.
114
112
115
113
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.
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.
122
120
123
121
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.
124
122
@@ -237,7 +235,11 @@ The following table provides several examples.
237
235
238
236
For more examples, see [XML Schema: Datatypes (W3.org web site)](https://www.w3.org/TR/xmlschema11-2/#dayTimeDuration).
239
237
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
241
243
242
244
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.
Copy file name to clipboardExpand all lines: articles/search/query-lucene-syntax.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -130,7 +130,7 @@ Proximity searches are used to find terms that are near each other in a document
130
130
131
131
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.
132
132
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).
134
134
135
135
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).
Copy file name to clipboardExpand all lines: articles/search/vector-search-how-to-query.md
+3-3Lines changed: 3 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -9,7 +9,7 @@ ms.service: cognitive-search
9
9
ms.custom:
10
10
- build-2024
11
11
ms.topic: how-to
12
-
ms.date: 08/19/2024
12
+
ms.date: 09/24/2024
13
13
---
14
14
15
15
# Create a vector query in Azure AI Search
@@ -463,8 +463,6 @@ Weights are used when calculating the [reciprocal rank fusion](hybrid-search-ran
463
463
464
464
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.
465
465
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
-
468
466
```http
469
467
POST https://[service-name].search.windows.net/indexes/[index-name]/docs/search?api-version=2024-07-01
470
468
@@ -489,6 +487,8 @@ POST https://[service-name].search.windows.net/indexes/[index-name]/docs/search?
489
487
}
490
488
```
491
489
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
+
492
492
## Set thresholds to exclude low-scoring results (preview)
493
493
494
494
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