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
+[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.
32
33
33
34
> [!Note]
34
35
> 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
45
46
46
47
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.
47
48
48
-

49
+

49
50
50
51
## Set up connections
51
52
52
-
1.In Visual Studio, open the **DotNetHowToIndexers.sln** file.
53
+
1.Start Visual Studio and open **DotNetHowToIndexers.sln**.
53
54
54
55
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".
55
56
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
+
```
63
64
64
65
The last entry requires an existing database. You'll create it in the next step.
65
66
@@ -79,7 +80,7 @@ If you have an existing Azure SQL Database resource, you can add the hotels tabl
79
80
80
81
1. On the navigation pane, click **Query editor (preview)** and enter the user name and password of server admin.
81
82
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.
83
84
84
85
1. In Query editor, click **Open query** and navigate to the location of *hotels.sql* file on your local computer.
85
86
@@ -95,9 +96,7 @@ If you have an existing Azure SQL Database resource, you can add the hotels tabl
95
96
SELECT * FROM Hotels
96
97
```
97
98
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.
@@ -113,15 +112,15 @@ If you have an existing Azure SQL Database resource, you can add the hotels tabl
113
112
}
114
113
```
115
114
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.
117
116
118
117
## Build the solution
119
118
120
119
1. Press F5 to build the solution. The program executes in debug mode. A console window reports the status of each operation.
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 andretrieve 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:
125
124
126
125
+ 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.
127
126
@@ -131,19 +130,19 @@ Your code runs locally in Visual Studio, connecting to your search service on Az
131
130
132
131
## Check results
133
132
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.
135
134
136
-
1. [Sign in to the Azure portal](https://portal.azure.com/), andin 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.
137
136
138
137

139
138
140
139
1. Select the hotels index. On the hotels page, **Search explorer** is the first tab.
141
140
142
-
1. Click **Search** to issue an empty search.
141
+
1. Click **Search** to issue an empty query.
143
142
144
143
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.
145
144
146
-

145
+

147
146
148
147
1. Next, enter a search string: `search=river&$count=true`.
149
148
@@ -153,12 +152,12 @@ Use Azure portal to verify objects, and then use **Search explorer** to query th
153
152
154
153
The query response is reduced to selected fields, resulting in more concise output.
155
154
156
-
## Understand the code
155
+
## Explore the code
157
156
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:
159
158
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
0 commit comments