Skip to content

Commit dbab233

Browse files
authored
Merge pull request #216081 from dereklegenzoff/delegenz/index-alias
updating alias docs to reflect latest functionality
2 parents 6058a3d + 4ed95fe commit dbab233

File tree

4 files changed

+29
-12
lines changed

4 files changed

+29
-12
lines changed
184 KB
Loading
Binary file not shown.

articles/search/search-how-to-alias.md

Lines changed: 27 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ Instead of dropping and rebuilding your index, you can use index aliases. A typi
2929

3030
## Create an index alias
3131

32-
You can create an alias using the preview REST API, the preview SDKs, or through [Visual Studio Code](search-get-started-vs-code.md). An alias consists of the `name` of the alias and the name of the search index that the alias is mapped to. Only one index name can be specified in the `indexes` array.
32+
You can create an alias using the preview REST API, the preview SDKs, or through the [Azure portal](https://portal.azure.com). An alias consists of the `name` of the alias and the name of the search index that the alias is mapped to. Only one index name can be specified in the `indexes` array.
3333

3434
### [**REST API**](#tab/rest)
3535

@@ -43,15 +43,32 @@ POST /aliases?api-version=2021-04-30-preview
4343
}
4444
```
4545

46-
### [**Visual Studio Code**](#tab/vscode)
46+
### [**Azure portal**](#tab/portal)
4747

48-
To create an alias in Visual Studio Code:
49-
1. Follow the steps in the [Visual Studio Code Quickstart](search-get-started-vs-code.md) to install the [Azure Cognitive Search extension](https://marketplace.visualstudio.com/items?itemName=ms-azuretools.vscode-azurecognitivesearch) and connect to your Azure Subscription.
50-
1. Navigate to your search service.
51-
1. Under your search service, right-click on **Aliases** and select **Create new alias**.
52-
1. Provide the name of your alias and the name of the search index you'd like to map it to and then save the file to create the alias.
48+
Follow the steps below to create an index alias in the Azure portal.
5349

54-
![Create an alias in VS Code](media/search-howto-alias/create-alias-vscode.png "Create an alias in VS Code")
50+
1. Navigate to your search service in the [Azure portal](https://portal.azure.com).
51+
1. Find and select **Aliases**.
52+
1. Select **+ Add Alias**.
53+
1. Give your index alias a name and select the search index you want to map the alias to. Then, select **Save**.
54+
55+
:::image type="content" source="media/search-howto-alias/create-alias-portal.png" alt-text="Screenshot creating an alias in the Azure portal." border="true":::
56+
57+
### [**.NET SDK**](#tab/sdk)
58+
59+
60+
In the preview [.NET SDK](https://www.nuget.org/packages/Azure.Search.Documents/11.5.0-beta.1) for Azure Cognitive Search, you can use the following syntax to create an index alias.
61+
62+
```csharp
63+
// Create a SearchIndexClient
64+
SearchIndexClient adminClient = new SearchIndexClient(serviceEndpoint, credential);
65+
66+
// Create an index alias
67+
SearchAlias myAlias = new SearchAlias("my-alias", "hotel-quickstart-index");
68+
adminClient.CreateAlias(myAlias);
69+
```
70+
71+
Index aliases are also supported in the latest preview SDKs for [Java](https://search.maven.org/artifact/com.azure/azure-search-documents/11.6.0-beta.1/jar), [Python](https://pypi.org/project/azure-search-documents/11.4.0b1/), and [JavaScript](https://www.npmjs.com/package/@azure/search-documents/v/11.3.0-beta.8).
5572

5673
---
5774

@@ -75,7 +92,7 @@ POST /indexes/my-alias/docs/search?api-version=2021-04-30-preview
7592
If you expect that you may need to make updates to your index definition for your production indexes, you should use an alias rather than the index name for requests in your client-side application. Scenarios that require you to create a new index are outlined under these [rebuild conditions](search-howto-reindex.md#rebuild-conditions).
7693

7794
> [!NOTE]
78-
> You can only use an alias with [document operations](/rest/api/searchservice/document-operations). Aliases can't be used to get or update an index definition, can't be used with the Analyze Text API, and can't be used as the `targetIndexName` on an indexer.
95+
> You can only use an alias with [document operations](/rest/api/searchservice/document-operations) or to get and update an index definition. Aliases can't be used to delete an index, can't be used with the Analyze Text API, and can't be used as the `targetIndexName` on an indexer.
7996
8097
## Swap indexes
8198

@@ -95,4 +112,4 @@ After you make the update to the alias, requests will automatically start to be
95112
96113
## See also
97114

98-
+ [Drop and rebuild an index in Azure Cognitive Search](search-howto-reindex.md)
115+
+ [Drop and rebuild an index in Azure Cognitive Search](search-howto-reindex.md)

articles/search/search-limits-quotas-capacity.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -124,11 +124,11 @@ Maximum number of synonym maps varies by tier. Each rule can have up to 20 expan
124124

125125
## Index alias limits
126126

127-
Maximum number of [index aliases](search-how-to-alias.md) varies by tier. In all tiers, the maximum number of aliases is the same as the maximum number of indexes.
127+
Maximum number of [index aliases](search-how-to-alias.md) varies by tier. In all tiers, the maximum number of aliases is double the maximum number of indexes allowed.
128128

129129
| Resource | Free | Basic | S1 | S2 | S3 | S3-HD |L1 | L2 |
130130
| -------- | -----|------ |----|----|----|-------|---|----|
131-
| Maximum aliases |3 |5 or 15 |50 |200 |200 |1000 per partition or 3000 per service |10 |10 |
131+
| Maximum aliases |6 |10 or 30 |100 |400 |400 |2000 per partition or 6000 per service |20 |20 |
132132

133133
## Data limits (AI enrichment)
134134

0 commit comments

Comments
 (0)