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/hybrid-search-how-to-query.md
+3-1Lines changed: 3 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -228,6 +228,8 @@ POST https://{{search-service-name}}.search.windows.net/indexes/{{index-name}}/d
228
228
229
229
Assuming that you [enabled semantic ranker](semantic-how-to-enable-disable.md) and your index definition includes a [semantic configuration](semantic-how-to-query-request.md), you can formulate a query that includes vector search and keyword search, with semantic ranking over the merged result set. Optionally, you can add captions and answers.
230
230
231
+
Whenever you use semantic ranking with vectors, make sure `k` is set to 50. Semantic ranker uses up to 50 matches as input. Specifying less than 50 deprives the semantic ranking models of necessary inputs.
232
+
231
233
```http
232
234
POST https://{{search-service-name}}.search.windows.net/indexes/{{index-name}}/docs/search?api-version=2024-07-01
233
235
Content-Type: application/json
@@ -306,7 +308,7 @@ api-key: {{admin-api-key}}
306
308
307
309
+ Prefiltering is applied before query execution. If prefilter reduces the search area to 100 documents, the vector query executes over the "DescriptionVector" field for those 100 documents, returning the k=50 best matches. Those 50 matching documents then pass to RRF for merged results, and then to semantic ranker.
308
310
309
-
+ Postfilter is applied after query execution. If k=50 returns 50 matches on the vector query side, then the post-filter is applied to the 50 matches, reducing results that meet filter criteria, leaving you with fewer than 50 documents to pass to semantic ranker.
311
+
+ Postfilter is applied after query execution. If k=50 returns 50 matches on the vector query side, followed by a post-filter applied to the 50 matches, your results are reduced by the number of document that meet filter criteria. This leaves you with fewer than 50 documents to pass to semantic ranker. Keep this in mind if you're using semantic ranking. The semantic ranker works best if it has 50 documents as input.
310
312
311
313
## Set maxTextRecallSize and countAndFacetMode (preview)
Copy file name to clipboardExpand all lines: articles/search/semantic-code-migration.md
+9-9Lines changed: 9 additions & 9 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -14,14 +14,14 @@ ms.date: 12/10/2024
14
14
15
15
# Migrate semantic ranking code from previous versions
16
16
17
-
If your semantic ranking code was written against preview APIs, this article explains how to migrate to newer APIs. Breaking changes for semantic ranker are limited to query logic in recent APIs, but if your code was written against the initial preview version, you might need to change your semantic configuration as well.
17
+
If your semantic ranking code was written against early preview APIs, this article identifies the code changes necessary for migrating to newer API versions. Breaking changes for semantic ranker are limited to query logic in recent APIs, but if your code was written against the initial preview version, you might need to change your semantic configuration as well.
18
18
19
19
## Breaking changes
20
20
21
21
There are two breaking changes for semantic ranker across REST API versions:
22
22
23
-
+`searchFields` replaced by `semanticConfiguration` in 2021-04-30-preview
24
-
+`queryLanguage` ignored in 2023-07-01-preview, but reinstated for query rewrite in 2024-11-01-preview
23
+
+`searchFields`was replaced by `semanticConfiguration` in 2021-04-30-preview
24
+
+`queryLanguage`was ignored starting in 2023-07-01-preview, but reinstated for query rewrite in 2024-11-01-preview
25
25
26
26
Other version-specific updates pertain to new capabilities, but don't break existing code and are therefore not breaking changes.
27
27
@@ -41,11 +41,11 @@ Check your code for the REST API version or SDK package version to confirm which
41
41
| preview |[2024-05-01-preview](/rest/api/searchservice/operation-groups?view=rest-searchservice-2024-05-01-preview&preserve-view=true)| No change |
42
42
| stable |[2024-07-01](/rest/api/searchservice/indexes/create-or-update?view=rest-searchservice-2024-07-01&preserve-view=true)| No change |
43
43
| preview |[2024-09-01-preview](/rest/api/searchservice/operation-groups?view=rest-searchservice-2024-09-01-preview&preserve-view=true)| No change |
44
-
| preview |[2024-11-01-preview](/rest/api/searchservice/operation-groups?view=rest-searchservice-2024-11-01-preview&preserve-view=true)| Adds query rewrite. The `queryLanguage` property is now required if you use [query rewrite (preview)](semantic-how-to-query-rewrite.md). For a list of valid values, see the [REST API](/rest/api/searchservice/documents/search-post?view=rest-searchservice-2024-11-01-preview#querylanguage&preserve-view=true).|
44
+
| preview |[2024-11-01-preview](/rest/api/searchservice/operation-groups?view=rest-searchservice-2024-11-01-preview&preserve-view=true)| Adds query rewrite. The `queryLanguage` property is now required if you use [query rewrite (preview)](semantic-how-to-query-rewrite.md). |
45
45
46
46
## Change logs for Azure SDKs
47
47
48
-
Azure SDKs are on an independent release schedule. You should check the change logs to determine which packages provide semantic features.
48
+
Azure SDKs are on an independent release schedule. You should check the change logs to determine which packages provide semantic features and whether any APIs have been renamed.
49
49
50
50
+[Azure SDK for .NET change log](https://github.com/Azure/azure-sdk-for-net/blob/Azure.Search.Documents_11.5.1/sdk/search/Azure.Search.Documents/CHANGELOG.md#1150-2023-11-10&preserve-view=true)
51
51
+[Azure SDK for Python change log](https://github.com/Azure/azure-sdk-for-python/blob/main/sdk/search/azure-search-documents/CHANGELOG.md#1140-2023-10-13&preserve-view=true)
@@ -55,7 +55,7 @@ Azure SDKs are on an independent release schedule. You should check the change l
55
55
## 2024-11-01-preview
56
56
57
57
+ Adds [query rewrite](semantic-how-to-query-rewrite.md) to Search Documents.
58
-
+ Requires `queryLanguage` for query rewrite workloads.
58
+
+ Requires `queryLanguage` for query rewrite workloads. For a list of valid values, see the [REST API](/rest/api/searchservice/documents/search-post?view=rest-searchservice-2024-11-01-preview#querylanguage&preserve-view=true).
59
59
60
60
## 2024-09-01-preview
61
61
@@ -73,7 +73,7 @@ No changes to semantic ranking syntax from the 2024-03-01-preview version.
73
73
74
74
## 2024-03-01-preview
75
75
76
-
No changes to semantic ranking syntax from the 2023-10-01-preview version, but vector queries are introduced. Semantic ranking now applies to responses from hybrid and vector queries, apply reranking on any human-readable text fields in the response.
76
+
No changes to semantic ranking syntax from the 2023-10-01-preview version, but vector queries are introduced. Semantic ranking now applies to responses from hybrid and vector queries. You can apply reranking on any human-readable text fields in the response, assuming the fields are listed in `prioritizedFields`.
77
77
78
78
## 2023-11-01
79
79
@@ -95,9 +95,9 @@ Starting on July 14, 2023, semantic ranker is language agnostic. In preview vers
95
95
96
96
+ Semantic support is through [Search Documents](/rest/api/searchservice/preview-api/search-documents) and [Create or Update Index](/rest/api/searchservice/preview-api/create-or-update-index) preview API calls.
97
97
+ Adds `semanticConfiguration` to a search index. A semantic configuration has a name and a prioritized field list.
98
-
+ Adds `semanticFields`.
98
+
+ Adds ``prioritizedFields`.
99
99
100
-
The `searchFields` property is no longer used to prioritize fields. In all versions moving forward, `semanticConfiguration.semanticFields` replaces `searchFields` as the mechanism for specifying which fields to use for L2 ranking.
100
+
The `searchFields` property is no longer used to prioritize fields. In all versions moving forward, `semanticConfiguration.prioritizedFields` replaces `searchFields` as the mechanism for specifying which fields to use for L2 ranking.
Copy file name to clipboardExpand all lines: articles/search/vector-search-how-to-query.md
+4-2Lines changed: 4 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -400,18 +400,20 @@ api-key: {{admin-api-key}}
400
400
"kind": "text",
401
401
"text": "mystery novel set in London",
402
402
"fields": "descriptionVector, synopsisVector",
403
-
"k": 5
403
+
"k": 50
404
404
},
405
405
{
406
406
"kind": "text"
407
407
"text": "living english author",
408
408
"fields": "authorBioVector",
409
-
"k": 5
409
+
"k": 50
410
410
}
411
411
]
412
412
}
413
413
```
414
414
415
+
Whenever you use semantic ranking with vectors, make sure `k` is set to 50. Semantic ranker uses up to 50 matches as input. Specifying less than 50 deprives the semantic ranking models of necessary inputs.
416
+
415
417
The scored results from all four queries are fused using [RRF ranking](hybrid-search-ranking.md). Secondary [semantic ranking](semantic-search-overview.md) is invoked over the fused search results, but on the `searchFields` only, boosting results that are the most semantically aligned to `"search":"mystery novel set in London"`.
0 commit comments