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/search-traffic-analytics.md
+33-12Lines changed: 33 additions & 12 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -197,25 +197,25 @@ The following screenshot shows the built-in reports and charts for analyzing sea
197
197
198
198
## Example
199
199
200
-
**Create your first search app in C#** is an ASP.NET Core solution that you can use to practice adding instrumentation code.
200
+
**Create your first search app in C#** is an ASP.NET Core sample that you can use to practice adding instrumentation code.
201
201
202
-
Use the sample code from the last lesson, [5 - Order results](https://docs.microsoft.com/en-us/azure/search/tutorial-csharp-orders), so that you can leverage search rank and more click behaviors. For this lesson, the [sample code](https://github.com/Azure-Samples/azure-search-dotnet-samples/tree/master/create-first-app/5-order-results) is located on GitHub.
202
+
We recommend using the sample code from [Lesson 5 - Order results](tutorial-csharp-orders.md). It adds search rank, providing a richer baseline for data collection. For this lesson, the [sample code](https://github.com/Azure-Samples/azure-search-dotnet-samples/tree/master/create-first-app/5-order-results) is located on GitHub.
203
203
204
-
1. Before adding Application Insights and instrumentation code, run the program to make sure there are no build errors.
204
+
1. Before adding Application Insights and instrumentation code, open **OrderResults.sln** in Visual Studio and run the program to make sure there are no build errors.
205
205
206
-
1.In Visual Studio, select **Project** > **Add Application Insights Telemetry**. For more information, see [Enable Application Insights server-side telemetry](https://docs.microsoft.com/azure/azure-monitor/app/asp-net-core#enable-application-insights-server-side-telemetry-visual-studio).
1. Select your subscription, account, resource, and click **Register***.
211
211
212
-
At this point, your application is set up for application monitoring, which means all page loads are tracked with default metrics.
212
+
At this point, your application is set up for application monitoring, which means all page loads are tracked with default metrics. For more information about the previous steps, see [Enable Application Insights server-side telemetry](https://docs.microsoft.com/azure/azure-monitor/app/asp-net-core#enable-application-insights-server-side-telemetry-visual-studio).
213
213
214
214
1. Open **HomeController.cs**.
215
215
216
-
1. On line 52, add `private static TelemetryClient _telemetryClient;` and when prompted, add `using Microsoft.ApplicationInsights;` as an assembly reference.
216
+
1. On line 267, add `private static TelemetryClient _telemetryClient;` and when prompted, add `using Microsoft.ApplicationInsights;` as an assembly reference.
217
217
218
-
1. On line 20, add a constructor that accepts a telemetry client:
218
+
1. On line 44, add a constructor that accepts a telemetry client:
219
219
220
220
```csharp
221
221
publicHomeController(TelemetryClienttelemetry)
@@ -224,22 +224,43 @@ Use the sample code from the last lesson, [5 - Order results](https://docs.micro
224
224
}
225
225
```
226
226
227
-
1.Correlate search and clicks events logged to Application Insights using the search ID. On line 79, add the following lines. When prompted, add `using System.Collections.Generic;` as an assembly reference.
227
+
1.Next, correlate search events and clicks events through the search ID. On line 191, add the following lines to your query logic.
228
228
229
229
```csharp
230
+
// Search Traffic Analytics: Establish a search ID used to correlate events
Instrument your search application to get powerful and insightful data about your search service.
244
265
245
266
You can find more information on [Application Insights](https://docs.microsoft.com/azure/azure-monitor/app/app-insights-overview) and visit the [pricing page](https://azure.microsoft.com/pricing/details/application-insights/) to learn more about their different service tiers.
0 commit comments