Skip to content

Commit b8b745d

Browse files
committed
edits
1 parent bd29f67 commit b8b745d

File tree

1 file changed

+24
-25
lines changed

1 file changed

+24
-25
lines changed

articles/search/search-indexer-tutorial.md

Lines changed: 24 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,8 @@ If you don't have an Azure subscription, create a [free account](https://azure.m
2828

2929
+ [Azure SQL Database](https://azure.microsoft.com/services/sql-database/)
3030
+ [Visual Studio](https://visualstudio.microsoft.com/downloads/)
31-
+ [Create a search service](search-create-service-portal.md) or [find an existing service](https://ms.portal.azure.com/#blade/HubsExtension/BrowseResourceBlade/resourceType/Microsoft.Search%2FsearchServices) under your current subscription. You can use a free service for this tutorial.
31+
32+
[Create](search-create-service-portal.md) or [find an existing search service](https://ms.portal.azure.com/#blade/HubsExtension/BrowseResourceBlade/resourceType/Microsoft.Search%2FsearchServices) under your current subscription. You can use a free service for this tutorial.
3233

3334
> [!Note]
3435
> A free search service limits you to three indexes, three indexers, and three data sources. This tutorial creates one of each. Before starting, make sure you have room on your service to accept the new resources.
@@ -45,21 +46,21 @@ API calls require the service URL and an access key. A search service is created
4546

4647
1. In **Settings** > **Keys**, get an admin key for full rights on the service. There are two interchangeable admin keys, provided for business continuity in case you need to roll one over. You can use either the primary or secondary key on requests for adding, modifying, and deleting objects.
4748

48-
![Get an HTTP endpoint and access key](media/search-get-started-postman/get-url-key.png "Get an HTTP endpoint and access key")
49+
![Get an HTTP endpoint and access key](media/search-get-started-postman/get-url-key.png "Get an HTTP endpoint and access key")
4950

5051
## Set up connections
5152

52-
1. In Visual Studio, open the **DotNetHowToIndexers.sln** file.
53+
1. Start Visual Studio and open **DotNetHowToIndexers.sln**.
5354

5455
1. In Solution Explorer, open **appsettings.json** and replace placeholder values with connection information to your search service. If the full URL is "https://my-demo-service.search.windows.net", the service name to provide is "my-demo-service".
5556

56-
```json
57-
{
58-
"SearchServiceName": "Put your search service name here",
59-
"SearchServiceAdminApiKey": "Put your primary or secondary API key here",
60-
"AzureSqlConnectionString": "Put your Azure SQL database connection string here",
61-
}
62-
```
57+
```json
58+
{
59+
"SearchServiceName": "Put your search service name here",
60+
"SearchServiceAdminApiKey": "Put your primary or secondary API key here",
61+
"AzureSqlConnectionString": "Put your Azure SQL database connection string here",
62+
}
63+
```
6364

6465
The last entry requires an existing database. You'll create it in the next step.
6566

@@ -79,7 +80,7 @@ If you have an existing Azure SQL Database resource, you can add the hotels tabl
7980

8081
1. On the navigation pane, click **Query editor (preview)** and enter the user name and password of server admin.
8182

82-
If you are not allowed access, copy the client IP address from the error message, and then click the **Set server firewall** link to add a rule that allows access from your client computer, using your client IP for the range. It can take several minutes for the rule to take effect.
83+
If access is denied, copy the client IP address from the error message, and then click the **Set server firewall** link to add a rule that allows access from your client computer, using your client IP for the range. It can take several minutes for the rule to take effect.
8384

8485
1. In Query editor, click **Open query** and navigate to the location of *hotels.sql* file on your local computer.
8586

@@ -95,9 +96,7 @@ If you have an existing Azure SQL Database resource, you can add the hotels tabl
9596
SELECT * FROM Hotels
9697
```
9798

98-
1. Copy the ADO.NET connection string for the database. On the SQL Database page of your database, go to **Settings** > **Connection Strings**, and copy the ADO.NET connection string.
99-
100-
An ADO.NET connection string looks like the following example, modified to use a valid database name, user name, and password.
99+
1. Copy the ADO.NET connection string for the database. Under **Settings** > **Connection Strings**, copy the ADO.NET connection string, similar to the example below.
101100

102101
```sql
103102
Server=tcp:{your_dbname}.database.windows.net,1433;Initial Catalog=hotels-db;Persist Security Info=False;User ID={your_username};Password={your_password};MultipleActiveResultSets=False;Encrypt=True;TrustServerCertificate=False;Connection Timeout=30;
@@ -113,15 +112,15 @@ If you have an existing Azure SQL Database resource, you can add the hotels tabl
113112
}
114113
```
115114

116-
1. Type your password into the connection string in the **appsettings.json** file. Other placeholder values for database and user name will copy over in your connection string, but the password will not be exposed.
115+
1. Enter your password into the connection string in the **appsettings.json** file. Database and user names will copy over in your connection string, but the password must be entered manually.
117116

118117
## Build the solution
119118

120119
1. Press F5 to build the solution. The program executes in debug mode. A console window reports the status of each operation.
121120

122-
![Console output](./media/search-indexer-tutorial/console-output.png "Console output")
121+
![Console output](./media/search-indexer-tutorial/console-output.png "Console output")
123122

124-
Your code runs locally in Visual Studio, connecting to your search service on Azure, which in turn uses the connection string to connect to Azure SQL Database and retrieve the dataset. With this many operations, there are several potential points of failure, but if you get an error, check the following conditions first:
123+
Your code runs locally in Visual Studio, connecting to your search service on Azure, which in turn connects to Azure SQL Database and retrieves the dataset. With this many operations, there are several potential points of failure. If you get an error, check the following conditions first:
125124

126125
+ Search service connection information that you provide is limited to the service name in this tutorial. If you entered the full URL, operations stop at index creation, with a failure to connect error.
127126

@@ -131,19 +130,19 @@ Your code runs locally in Visual Studio, connecting to your search service on Az
131130

132131
## Check results
133132

134-
Use Azure portal to verify objects, and then use **Search explorer** to query the index.
133+
Use Azure portal to verify object creation, and then use **Search explorer** to query the index.
135134

136-
1. [Sign in to the Azure portal](https://portal.azure.com/), and in your search service **Overview** page, open each list in turn to verify the object is created. **Indexes**, **Indexers**, and **Data Sources** will have "hotels", "azure-blob-indexer", and "azure-sql", respectively.
135+
1. [Sign in to the Azure portal](https://portal.azure.com/), and in your search service **Overview** page, open each list in turn to verify the object is created. **Indexes**, **Indexers**, and **Data Sources** will have "hotels", "azure-sql-indexer", and "azure-sql", respectively.
137136

138137
![Indexer and data source tiles](./media/search-indexer-tutorial/tiles-portal.png)
139138

140139
1. Select the hotels index. On the hotels page, **Search explorer** is the first tab.
141140

142-
1. Click **Search** to issue an empty search.
141+
1. Click **Search** to issue an empty query.
143142

144143
The three entries in your index are returned as JSON documents. Search explorer returns documents in JSON so that you can view the entire structure.
145144

146-
![Query an index](./media/search-indexer-tutorial/portal-search.png "Query an index")
145+
![Query an index](./media/search-indexer-tutorial/portal-search.png "Query an index")
147146

148147
1. Next, enter a search string: `search=river&$count=true`.
149148

@@ -153,12 +152,12 @@ Use Azure portal to verify objects, and then use **Search explorer** to query th
153152

154153
The query response is reduced to selected fields, resulting in more concise output.
155154

156-
## Understand the code
155+
## Explore the code
157156

158-
Now that you understand what the sample code does, lets return to the source to review its contents. Relevant code is in two files:
157+
Now that you understand what the sample code create, let's return to the solution to review the code. Relevant code is in two files:
159158

160-
+ **hotel.cs**, containing the schema that defines the index
161-
+ **Program.cs**, containing the functions for creating and managing structures in your service
159+
+ **hotel.cs**, containing a schema that defines the index
160+
+ **Program.cs**, containing functions for creating and managing structures in your service
162161

163162
### In hotel.cs
164163

0 commit comments

Comments
 (0)