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/search-api-migration.md
+45-25Lines changed: 45 additions & 25 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -11,41 +11,35 @@ ms.custom:
11
11
- ignite-2023
12
12
- build-2024
13
13
ms.topic: conceptual
14
-
ms.date: 05/09/2024
14
+
ms.date: 06/03/2024
15
15
---
16
16
17
17
# Upgrade to the latest REST API in Azure AI Search
18
18
19
19
Use this article to migrate data plane calls to newer versions of the [**Search REST APIs**](/rest/api/searchservice/).
20
20
21
-
+[**2023-11-01**](/rest/api/searchservice/search-service-api-versions#2023-11-01) is the most recent stable version. Semantic ranking and support for vector indexing and queries are generally available in this version.
21
+
+[**`2023-11-01`**](/rest/api/searchservice/search-service-api-versions#2023-11-01) is the most recent stable version.
22
22
23
-
If you're upgrading from 2023-10-01-preview to 2023-11-01, there are no breaking changes, but there's one behavior difference: the `vectorFilterMode` default changed from postfilter to prefilter for [filter expressions](vector-search-filters.md). If your 2023-10-01-preview code doesn't set `vectorFilterMode` explicitly, make sure you understand the new default behavior, or explicitly set `vectorFilterMode` to postfilter to retain the old behavior.
23
+
+[**`2024-05-01-preview`**](/rest/api/searchservice/search-service-api-versions#2023-10-01-preview) is the most recent preview API version.
24
24
25
-
+[**2024-05-01-preview**](/rest/api/searchservice/search-service-api-versions#2023-10-01-preview) is the most recent preview API version. It adds a binary data type for vector fields, relevance properties for better search results, OneLake files indexer, more vectorizers, and more embedding skills. AzureOpenAIEmbedding skill is updated to include `dimensions` and `modelName` properties. The only backwards compatibility issue between this preview and the previous two previews is that `modelName` is now required.
26
-
27
-
+[**2024-03-01-preview**](/rest/api/searchservice/search-service-api-versions#2023-10-01-preview) adds new data types and properties for compression, but is otherwise fully backward compatible with 2023-10-01-preview. There are no upgrade instructions for using this preview.
28
-
29
-
+[**2023-10-01-preview**](/rest/api/searchservice/search-service-api-versions#2023-10-01-preview) is the first preview version that added [built-in query vectorization](vector-search-how-to-configure-vectorizer.md), [built-in data chunking and vectorization during indexing](vector-search-integrated-vectorization.md) (uses the [Text Split](cognitive-search-skill-textsplit.md) skill and [Azure OpenAI Embedding](cognitive-search-skill-azure-openai-embedding.md) skill). It introduces breaking changes in vector configuration in the index and vector queries.
30
-
31
-
+**2023-07-01-preview** was the first REST API for vector support. It's now deprecated and you should migrate to either **2023-11-01** or any of the newer preview REST APIs immediately.
25
+
**`2023-07-01-preview`** was the first REST API for vector support. It's now deprecated and you should migrate to either stable or newer preview REST APIs immediately.
32
26
33
27
> [!NOTE]
34
-
> REST API reference docs are now versioned. To get the right content, open a reference page and then filter by version, using the selector located above the table of contents.
28
+
> REST API reference docs are now versioned. To get version-specific content, open a reference page and then filter by version, using the selector located above the table of contents.
35
29
36
30
## When to upgrade
37
31
38
32
Azure AI Search breaks backward compatibility as a last resort. Upgrade is necessary when:
39
33
40
-
+ Your code references a retired or deprecated API version and is subject to one or more of the breaking changes. API versions that fall into this category include [2023-07-10-preview](#code-upgrade-for-vector-indexes-and-queries) for vectors, and [2019-05-06](#upgrade-to-2019-05-06) for obsolete skills and workarounds.
34
+
+ Your code references a retired or deprecated API version and is subject to one or more breaking changes. You must address breaking changes if your code targets [`2023-07-10-preview`](#code-upgrade-for-vector-indexes-and-queries) for vectors, [`2020-06-01-preview]`(#breaking-change-for-semantic-ranking) for semantic ranking, and [`2019-05-06`](#upgrade-to-2019-05-06) for obsolete skills and workarounds.
41
35
42
36
+ Your code fails when unrecognized properties are returned in an API response. As a best practice, your application should ignore properties that it doesn't understand.
43
37
44
38
+ Your code persists API requests and tries to resend them to the new API version. For example, this might happen if your application persists continuation tokens returned from the Search API (for more information, look for `@search.nextPageParameters` in the [Search API Reference](/rest/api/searchservice/Search-Documents)).
45
39
46
40
## Breaking change for client code that reads connection information
47
41
48
-
Effective March 29, 2024 and applies to all [supported REST APIs](/rest/api/searchservice/search-service-api-versions):
42
+
Effective March 29, 2024 and applicable to all [supported REST APIs](/rest/api/searchservice/search-service-api-versions):
49
43
50
44
+[GET Skillset](/rest/api/searchservice/skillsets/get), [GET Index](/rest/api/searchservice/indexes/get), and [GET Indexer](/rest/api/searchservice/indexers/get) no longer return keys or connection properties in a response. This is a breaking change if you have downstream code that reads keys or connections (sensitive data) from a GET response.
51
45
@@ -55,40 +49,66 @@ Effective March 29, 2024 and applies to all [supported REST APIs](/rest/api/sear
55
49
56
50
## Breaking change for semantic ranking
57
51
58
-
[Semantic ranking](semantic-search-overview.md) is generally available in 2023-11-01. In contrast with previous REST API versions, it no longer uses the `queryLanguage` property. It also requires a `semanticConfiguration` definition that replaces the `searchFields` in early previous versions. See [Migrate from preview version](semantic-how-to-configure.md#migrate-from-preview-versions) to transition your code to the generally available version or to a newer preview version.
52
+
[Semantic ranking](semantic-search-overview.md) is generally available in `2023-11-01`. Here are the breaking changes for semantic ranking from earlier releases:
53
+
54
+
+ In all versions after `2020-06-01-preview`: `semanticConfiguration` replaces `searchFields` as the mechanism for specifying which fields to use for L2 ranking.
55
+
56
+
+ For all API versions, updates on July 14, 2023 to the Microsoft-hosteed semantic models made semantic ranking language-agnostic, effectively decommissioning the `queryLanguage` property. There's no "breaking change" in code, but the property is ignored.
57
+
58
+
See [Migrate from preview version](semantic-how-to-configure.md#migrate-from-preview-versions) to transition your code to use `semanticConfiguration`.
59
+
60
+
## Upgrade from 2024-03-01-preview
61
+
62
+
[`2024-03-01-preview`](/rest/api/searchservice/search-service-api-versions#2023-10-01-preview) adds new data types and properties for compression.
63
+
64
+
If you're upgrading from `2024-03-01-preview`, the AzureOpenAIEmbedding skill now requires a model name and dimensions property.
65
+
66
+
1. Search your codebase for [AzureOpenAIEmbedding](cognitive-search-skill-azure-openai-embedding.md) references.
67
+
68
+
1. Set `modelName` to "text-embedding-ada-002" and set `dimensions` to "1536".
69
+
70
+
## Upgrade from 2023-10-01-preview
71
+
72
+
[`2023-10-01-preview`](/rest/api/searchservice/search-service-api-versions#2023-10-01-preview) was the first preview version to add [built-in data chunking and vectorization during indexing](vector-search-integrated-vectorization.md) and [built-in query vectorization](vector-search-how-to-configure-vectorizer.md).
73
+
74
+
If your code currently targets `2023-10-01-preview`, you can target `2023-11-01` or `2024-03-01-preview` with no breaking changes. However, there's one behavior difference: for `2023-11-01` and newer previews, the `vectorFilterMode` default changed from postfilter to prefilter for [filter expressions](vector-search-filters.md).
75
+
76
+
1. Search your codebase for `vectorFilterMode` references.
77
+
78
+
1. If the property is explicitly set, no action is required. If you used the default, be aware that the new default behavior is to filter before query execution. If you want post-query filtering, explicitly set `vectorFilterMode` to postfilter to retain the old behavior.
59
79
60
80
## Upgrade from 2023-07-01-preview
61
81
62
-
This section explains the migration path from 2023-07-01-preview to any newer API version. There are several breaking changes from 2023-07-01-preview to any newer version, but only minor compatibility issues between the newer API versions that follow.
82
+
This section explains the migration path from 2023-07-01-preview to any newer API version. There are multiple breaking changes from `2023-07-01-preview` to any newer version.
63
83
64
84
Upgrade instructions focus on code changes that get you through breaking changes from previous versions so that existing code runs the same as before, but on the newer API version. Once your code is in working order, you can decide whether to adopt newer features. To learn more about preview features, see [vector code samples](https://github.com/Azure/azure-search-vector-samples) and [What's New](whats-new.md).
65
85
66
86
### Portal upgrade for vector indexes
67
87
68
-
Azure portal supports a one-click upgrade path for 2023-07-01-preview indexes. The portal detects 2023-07-01-preview vector fields and provides a **Migrate** button.
88
+
Azure portal supports a one-click upgrade path for `2023-07-01-preview` indexes. It detects vector fields and provides a **Migrate** button.
69
89
70
-
+ Migration path is from 2023-07-01-preview to 2023-10-01-preview.
90
+
+ Migration path is from `2023-07-01-preview` to `2024-05-01-preview`.
71
91
+ Updates are limited to vector field definitions and vector search algorithm configurations.
72
-
+ Updates are one-way. You can't reverse the upgrade. Once the index is upgraded, you must use 2023-10-01-preview or later to query the index.
92
+
+ Updates are one-way. You can't reverse the upgrade. Once the index is upgraded, you must use `2024-05-01-preview` or later to query the index.
73
93
74
94
There's no portal migration for upgrading vector query syntax. See [code upgrades](#code-upgrade-for-vector-indexes-and-queries) for query syntax changes.
75
95
76
-
Before selecting **Migrate**, select **Edit JSON** to review the updated schema first. You should find a schema that conforms to the changes described in the [code upgrade](#code-upgrade-for-vector-indexes-and-queries) section. Portal migration only handles indexes with one vector search algorithm configuration. It creates a default profile that maps to the 2023-07-01-preview vector search algorithm. Indexes with multiple vector search configurations require manual migration.
96
+
Before selecting **Migrate**, select **Edit JSON** to review the updated schema first. You should find a schema that conforms to the changes described in the [code upgrade](#code-upgrade-for-vector-indexes-and-queries) section. Portal migration only handles indexes with one vector search algorithm configuration. It creates a default profile that maps to the `2023-07-01-preview` vector search algorithm. Indexes with multiple vector search configurations require manual migration.
77
97
78
98
### Code upgrade for vector indexes and queries
79
99
80
100
[Vector search](vector-search-overview.md) support was introduced in [Create or Update Index (2023-07-01-preview)](/rest/api/searchservice/preview-api/create-or-update-index).
81
101
82
-
Upgrading from 2023-07-01-preview to any newer stable or preview version requires:
102
+
Upgrading from `2023-07-01-preview` to any newer stable or preview version requires:
83
103
84
104
+ Renaming and restructuring the vector configuration in the index
85
105
+ Rewriting your vector queries
86
106
87
-
Use the instructions in this section to migrate vector fields, configuration, and queries from 2023-07-01-preview.
107
+
Use the instructions in this section to migrate vector fields, configuration, and queries from `2023-07-01-preview`.
88
108
89
109
1. Call [Get Index](/rest/api/searchservice/indexes/get?view=rest-searchservice-2023-11-01&tabs=HTTP&preserve-view=true) to retrieve the existing definition.
90
110
91
-
1. Modify the vector search configuration. 2023-11-01 and later versions introduce the concept of *vector profiles* that bundle vector-related configurations under one name. Newer versions also rename `algorithmConfigurations` to `algorithms`.
111
+
1. Modify the vector search configuration. `2023-11-01` and later versions introduce the concept of *vector profiles* that bundle vector-related configurations under one name. Newer versions also rename `algorithmConfigurations` to `algorithms`.
92
112
93
113
+ Rename `algorithmConfigurations` to `algorithms`. This is only a renaming of the array. The contents are backwards compatible. This means your existing HNSW configuration parameters can be used.
94
114
@@ -189,7 +209,7 @@ Use the instructions in this section to migrate vector fields, configuration, an
189
209
+ Rename `vectors` to `vectorQueries`.
190
210
+ For each vector query, add `kind`, setting it to `vector`.
191
211
+ For each vector query, rename `value` to `vector`.
192
-
+ Optionally, add `vectorFilterMode` if you're using [filter expressions](vector-search-filters.md). The default is prefilter for indexes created after 2023-10-01. Indexes created before that date only support postfilter, regardless of how you set the filter mode.
212
+
+ Optionally, add `vectorFilterMode` if you're using [filter expressions](vector-search-filters.md). The default is prefilter for indexes created after `2023-10-01`. Indexes created before that date only support postfilter, regardless of how you set the filter mode.
193
213
194
214
**Before (2023-07-01-preview)**:
195
215
@@ -237,7 +257,7 @@ Use the instructions in this section to migrate vector fields, configuration, an
237
257
}
238
258
```
239
259
240
-
These steps complete the migration to 2023-11-01 stable API version or newer preview API versions.
260
+
These steps complete the migration to `2023-11-01` stable API version or newer preview API versions.
241
261
242
262
## Upgrade to 2020-06-30
243
263
@@ -284,7 +304,7 @@ API version `2019-05-06` added formal support for complex types. If your code im
284
304
285
305
+ The limits on the depth of subfields and the number of complex collections per index have been lowered. If you created indexes that exceed these limits using the preview api-versions, any attempt to update or recreate them using API version `2019-05-06` will fail. If you find yourself in this situation, you need to redesign your schema to fit within the new limits and then rebuild your index.
286
306
287
-
+ There's a new limit starting in api-version `2019-05-06` on the number of elements of complex collections per document. If you created indexes with documents that exceed these limits using the preview api-versions, any attempt to reindex that data using api-version `2019-05-06` will fail. If you find yourself in this situation, you need to reduce the number of complex collection elements per document before reindexing your data.
307
+
+ There's a new limit starting in api-version `2019-05-06` on the number of elements of complex collections per document. If you created indexes with documents that exceed these limits using the preview api-versions, any attempt to reindex that data using api-version `2019-05-06` fails. If you find yourself in this situation, you need to reduce the number of complex collection elements per document before reindexing your data.
288
308
289
309
For more information, see [Service limits for Azure AI Search](search-limits-quotas-capacity.md).
0 commit comments