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/tutorial-optimize-indexing-push-api.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
@@ -1,7 +1,7 @@
1
1
---
2
-
title: 'C# tutorial: Optimize indexing with the push API'
2
+
title: 'C# tutorial: Optimize indexing by using the push API'
3
3
titleSuffix: Azure AI Search
4
-
description: Learn how to efficiently index data using Azure AI Search's push API. This tutorial and sample code are in C#.
4
+
description: Learn how to efficiently index data by using Azure AI Search's push API. This tutorial and sample code are in C#.
5
5
author: gmndrg
6
6
ms.author: gimondra
7
7
ms.service: azure-ai-search
@@ -12,7 +12,7 @@ ms.custom:
12
12
- ignite-2023
13
13
---
14
14
15
-
# Tutorial: Optimize indexing with the push API
15
+
# Tutorial: Optimize indexing by using the push API
16
16
17
17
Azure AI Search supports [two basic approaches](search-what-is-data-import.md) for importing data into a search index: *push* your data into the index programmatically, or *pull* in the data by pointing an [Azure AI Search indexer](search-indexer-overview.md) at a supported data source.
18
18
@@ -70,7 +70,7 @@ This tutorial uses key-based authentication. Copy an admin API key to paste into
70
70
71
71
1. Start Visual Studio and open *OptimizeDataIndexing.sln*.
72
72
73
-
1. In Solution Explorer, open *appsettings.json* to provide connection information.
73
+
1. In Solution Explorer, open *appsettings.json* to provide your service's connection information.
74
74
75
75
```json
76
76
{
@@ -88,15 +88,15 @@ This code is derived from the C# section of [Quickstart: Full text search using
88
88
89
89
This simple C#/.NET console app performs the following tasks:
90
90
91
-
+ Creates a new index based on the data structure of the C# `Hotel` class (which also references the `Address` class).
91
+
+ Creates a new index based on the data structure of the C# `Hotel` class (which also references the `Address` class)
92
92
+ Tests various batch sizes to determine the most efficient size
93
93
+ Indexes data asynchronously
94
94
+ Using multiple threads to increase indexing speeds
95
95
+ Using an exponential backoff retry strategy to retry failed items
96
96
97
97
Before running the program, take a minute to study the code and the index definitions for this sample. The relevant code is in several files:
98
98
99
-
+*Hotel.cs* and *Address.cs*contains the schema that defines the index
99
+
+*Hotel.cs* and *Address.cs*contain the schema that defines the index
100
100
+*DataGenerator.cs* contains a simple class to make it easy to create large amounts of hotel data
101
101
+*ExponentialBackoff.cs* contains code to optimize the indexing process as described in this article
102
102
+*Program.cs* contains functions that create and delete the Azure AI Search index, indexes batches of data, and tests different batch sizes
@@ -242,8 +242,8 @@ Identify which batch size is most efficient and then use that batch size in the
242
242
243
243
Now that you identified the batch size you intend to use, the next step is to begin to index the data. To index data efficiently, this sample:
244
244
245
-
+ uses multiple threads/workers.
246
-
+ implements an exponential backoff retry strategy.
245
+
+ uses multiple threads/workers
246
+
+ implements an exponential backoff retry strategy
247
247
248
248
Uncomment lines 41 through 49, and then rerun the program. On this run, the sample generates and sends batches of documents, up to 100,000 if you run the code without changing the parameters.
249
249
@@ -360,7 +360,7 @@ After the function is finished running, you can verify that all of the documents
360
360
361
361
## Step 6: Explore the index
362
362
363
-
You can explore the populated search index after the program has run programmatically or by using the [Search explorer](search-explorer.md) in the portal.
363
+
You can explore the populated search index after the program has run either programmatically or by using the [Search explorer](search-explorer.md) in the portal.
0 commit comments