Skip to content

Commit 47eab3d

Browse files
committed
Added example
1 parent b374b7a commit 47eab3d

File tree

4 files changed

+53
-18
lines changed

4 files changed

+53
-18
lines changed

articles/search/search-howto-reindex.md

Lines changed: 42 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -14,17 +14,17 @@ ms.date: 07/01/2024
1414

1515
# Update or rebuild an index in Azure AI Search
1616

17-
This article explains how to update an existing index in Azure AI Search with incremental indexing. It explains the circumstances under which rebuilds are required, and provides recommendations for mitigating the effects of rebuilds on ongoing query requests.
17+
This article explains how to update an existing index in Azure AI Search with schema changes or content changes through incremental indexing. It explains the circumstances under which rebuilds are required, and provides recommendations for mitigating the effects of rebuilds on ongoing query requests.
1818

1919
During active development, it's common to drop and rebuild indexes when you're iterating over index design. Most developers work with a small representative sample of their data so that reindexing goes faster.
2020

21-
For applications already in production, we recommend creating a new index that runs side by side an existing index to avoid query downtime and using an [index alias](search-how-to-alias.md) to avoid changing your application code.
21+
For large schema changes on applications already in production, we recommend creating a new index that runs side by side an existing index to avoid query downtime and using an [index alias](search-how-to-alias.md) to avoid changing your application code.
2222

2323
## Update content
2424

25-
Incremental indexing and synchronizing an index against changes in source data is a basic requirement for most search applications. This section explains the workflow for overwriting field contents in a search index.
25+
Incremental indexing and synchronizing an index against changes in source data is fundamental to most search applications. This section explains the workflow for updating field contents in a search index.
2626

27-
1. Use the same techniques for loading documents: [Documents - Index (REST)](/rest/api/searchservice/documents) or an equivalent API in the Azure SDKs. For more information about indexing, see [Load documents](search-how-to-load-search-index.md).
27+
1. Use the same techniques for loading documents: [Documents - Index (REST)](/rest/api/searchservice/documents) or an equivalent API in the Azure SDKs. For more information about indexing techniques, see [Load documents](search-how-to-load-search-index.md).
2828

2929
1. Set the `@search.action` parameter to determine the effect on existing documents:
3030

@@ -41,13 +41,47 @@ Queries continue to run, but if you're updating or removing existing fields, you
4141

4242
## Tips for incremental indexing
4343

44-
+ Use `mergeOrUpload` as the search action.
44+
+ [Indexers automate incremental indexing](search-indexer-overview.md). If you can use an indexer, and if the data source supports change tracking, you can run the indexer on a recurring schedule to add, update, or overwrite searchable content so that it's synchronized to your external data.
4545

46-
+ The payload must include the keys or identifiers of every document you want to add, update, or delete.
46+
+ If you're making index calls directly, use `mergeOrUpload` as the search action.
4747

48-
+ For merging, avoid listing fields that contain content you want to preserve. For example, if you populated vector fields, but only need to update a few nonvector fields, the payload should list just those fields you want to update. Specifying an empty field overwrites the existing value with a null value.
48+
+ The payload must include the keys or identifiers of every document you want to add, update, or delete.
4949

50-
+ [Indexers automate incremental indexing](search-indexer-overview.md). If you can use an indexer, and if the data source supports change tracking, you can run the indexer on a recurring schedule to add, update, and delete an index so that it's synchronized to your external data.
50+
+ For updating the contents of simple fields and subfields in complex types, list only the fields you want to change. For example, if you only need to update a description field, the payload should consist of the document key and the modified description. Omitting other fields retains their existing values.
51+
52+
+ For merging inline changes into string collection, provide the entire value. Recall the `tags` field example from the previous section. New values overwrite the old values, and there is no merging at the field content level.
53+
54+
Here's a [REST API example](search-get-started-rest.md) demonstrating these tips:
55+
56+
```rest
57+
### Get Secret Point Hotel by ID
58+
GET {{baseUrl}}/indexes/hotels-vector-quickstart/docs('1')?api-version=2023-11-01 HTTP/1.1
59+
Content-Type: application/json
60+
api-key: {{apiKey}}
61+
62+
### Change the description and city for Secret Point Hotel
63+
POST {{baseUrl}}/indexes/hotels-vector-quickstart/docs/search.index?api-version=2023-11-01 HTTP/1.1
64+
Content-Type: application/json
65+
api-key: {{apiKey}}
66+
67+
{
68+
"value": [
69+
{
70+
"@search.action": "mergeOrUpload",
71+
"HotelId": "1",
72+
"Description": "I'm changing the description and city for Secret Point Hotel, and keeping everything else."
73+
"Address": {
74+
"City": "Miami"
75+
}
76+
}
77+
]
78+
}
79+
80+
### Retrieve the same document, confirm the overwrites and retention of all other values
81+
GET {{baseUrl}}/indexes/hotels-vector-quickstart/docs('1')?api-version=2023-11-01 HTTP/1.1
82+
Content-Type: application/json
83+
api-key: {{apiKey}}
84+
```
5185

5286
## Change an index schema
5387

articles/search/search-security-enable-roles.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,10 +25,10 @@ Roles for service administration (control plane) are built in and can't be enabl
2525
2626
## Prerequisites
2727

28-
+ Owner, User Access Administrator, or a custom role with [Microsoft.Authorization/roleAssignments/write](/azure/templates/microsoft.authorization/roleassignments) permissions.
29-
3028
+ A search service in any region, on any tier, including free.
3129

30+
+ Owner, User Access Administrator, or a custom role with [Microsoft.Authorization/roleAssignments/write](/azure/templates/microsoft.authorization/roleassignments) permissions.
31+
3232
## Enable role-based access for data plane operations
3333

3434
Configure your search service to recognize an **authorization** header on data requests that provide an OAuth2 access token.

articles/search/search-security-rbac.md

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,10 +30,10 @@ Role-based access is optional, but recommended. The alternative is [key-based au
3030

3131
## Prerequisites
3232

33-
+ **Owner**, **User Access Administrator**, or a custom role with [Microsoft.Authorization/roleAssignments/write](/azure/templates/microsoft.authorization/roleassignments) permissions.
34-
3533
+ A search service in any region, on any tier, [enabled for role-based access](search-security-enable-roles.md).
3634

35+
+ Owner, User Access Administrator, or a custom role with [Microsoft.Authorization/roleAssignments/write](/azure/templates/microsoft.authorization/roleassignments) permissions.
36+
3737
<a name = "built-in-roles-used-in-search"></a>
3838

3939
## Built-in roles used in Azure AI Search
@@ -51,7 +51,6 @@ The following roles are built in. If these roles are insufficient, [create a cus
5151

5252
Combine these roles to get sufficient permissions for your use case.
5353

54-
5554
> [!NOTE]
5655
> If you disable Azure role-based access, built-in roles for the control plane (Owner, Contributor, Reader) continue to be available. Disabling role-based access removes just the data-related permissions associated with those roles. If data plane roles are disabled, Search Service Contributor is equivalent to control-plane Contributor.
5756

articles/search/service-configure-firewall.md

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,9 @@ ms.date: 06/27/2024
1515

1616
# Configure network access and firewall rules for Azure AI Search
1717

18-
This article explains how to configure network access to a search service's public endpoint. To block *all* data plane access to the public endpoint, use [private endpoints](service-create-private-endpoint.md) and an Azure virtual network.
18+
This article explains how to restrict network access to a search service's public endpoint. To block *all* data plane access to the public endpoint, use [private endpoints](service-create-private-endpoint.md) and an Azure virtual network.
1919

20-
This article assumes the Azure portal to configure network access options. You can also use the [Management REST API](/rest/api/searchmanagement/), [Azure PowerShell](/powershell/module/az.search), or the [Azure CLI](/cli/azure/search).
20+
This article assumes the Azure portal for configuring network access options. You can also use the [Management REST API](/rest/api/searchmanagement/), [Azure PowerShell](/powershell/module/az.search), or the [Azure CLI](/cli/azure/search).
2121

2222
## Prerequisites
2323

@@ -29,7 +29,9 @@ This article assumes the Azure portal to configure network access options. You c
2929

3030
By default, Azure AI Search is configured to allow connections over a public endpoint. Access to a search service *through* the public endpoint is protected by authentication and authorization protocols, but the endpoint itself is open to the internet at the network layer for data plane requests.
3131

32-
If you aren't hosting a public web site, you might want to configure network access to automatically refuse requests unless they originate from an approved set of devices and cloud services. There are two mechanisms:
32+
If you aren't hosting a public web site, you might want to configure network access to automatically refuse requests unless they originate from an approved set of devices and cloud services.
33+
34+
There are two mechanisms for restricting access to the public endpoint:
3335

3436
+ Inbound rules listing the IP addresses, ranges, or subnets from which requests are admitted
3537
+ Exceptions to network rules, where requests are admitted with no checks, as long as the request originates from a [trusted service](#grant-access-to-trusted-azure-services)
@@ -44,7 +46,7 @@ There are a few drawbacks to locking down the public endpoint.
4446

4547
+ It takes time to fully identify IP ranges and set up firewalls, and if you're in early stages of proof-of-concept testing and investigation and using sample data, you might want to defer network access controls until you actually need them.
4648

47-
+ Some workflows require access to a public endpoint. Specifically, the import wizards in the Azure portal, such as the [Import data wizard](search-get-started-portal.md) and [Import and vectorize data wizard](search-get-started-portal-import-vectors.md), connect to built-in (hosted) sample data and embedding models over the public endpoint. You can switch to code or script to complete the same tasks with firewall rules in place, but if you want to run the wizards, the public endpoint must be available. For more information, see [Secure connections in the import wizards](search-import-data-portal.md#secure-connections).
49+
+ Some workflows require access to a public endpoint. Specifically, the [**import wizards**](search-data-import-portal.md) in the Azure portal connect to built-in (hosted) sample data and embedding models over the public endpoint. You can switch to code or script to complete the same tasks when firewall rules in place, but if you want to run the wizards, the public endpoint must be available. For more information, see [Secure connections in the import wizards](search-import-data-portal.md#secure-connections).
4850

4951
<a id="configure-ip-policy"></a>
5052

@@ -62,7 +64,7 @@ There are a few drawbacks to locking down the public endpoint.
6264

6365
:::image type="content" source="media/service-configure-firewall/azure-portal-firewall-all.png" alt-text="Screenshot showing how to configure the IP firewall in the Azure portal.":::
6466

65-
1. Under **IP Firewall**, select **Add your client IP address** to create an inbound rule for the public IP address of your system. See [Allow access from the Azure portal IP address](#allow-access-from-the-azure-portal-ip-address) for details.
67+
1. Under **IP Firewall**, select **Add your client IP address** to create an inbound rule for the public IP address of your personal device. See [Allow access from the Azure portal IP address](#allow-access-from-the-azure-portal-ip-address) for details.
6668

6769
1. Add other client IP addresses for other devices and services that send requests to a search service.
6870

0 commit comments

Comments
 (0)