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
+15-19Lines changed: 15 additions & 19 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,5 +1,5 @@
1
1
---
2
-
title: Search traffic telemetry data
2
+
title: Telemetry for search traffic analytics
3
3
titleSuffix: Azure Cognitive Search
4
4
description: Enable search traffic analytics for Azure Cognitive Search, collect telemetry and user-initiated events using Application Insights, and then analyze findings in a Power BI report.
5
5
@@ -16,28 +16,24 @@ ms.date: 03/18/2020
16
16
17
17
Search traffic analytics is a pattern for implementing a feedback loop for your Azure Cognitive Search service. The objective is to collect telemetry on user-initiated click events and keyboard inputs. Using this information, you can determine the effectiveness of your search solution, including popular search terms, clickthrough rate, and which query inputs yield zero results.
18
18
19
-
This pattern takes a dependency on [Application Insights](https://docs.microsoft.com/azure/azure-monitor/app/app-insights-overview) (a feature of [Azure Monitor](https://docs.microsoft.com/azure/azure-monitor/)) to collect user data. You will also need to add instrumentation to your client code, as described in this article. Finally, you will need a reporting mechanism to analyze the data. We recommend Power BI but you can use any tool that connects to Application Insights.
19
+
This pattern takes a dependency on [Application Insights](https://docs.microsoft.com/azure/azure-monitor/app/app-insights-overview) (a feature of [Azure Monitor](https://docs.microsoft.com/azure/azure-monitor/)) to collect user data. You will also need to add instrumentation to your client code, as described in this article. Finally, you will need a reporting mechanism to analyze the data. We recommend Power BI but you can use the Application Dashboard or any tool that connects to Application Insights.
20
20
21
21
> [!NOTE]
22
22
> The pattern described in this article is for advanced scenarios and clickstream data generated by your client. Alternatively, you can report on log information generated by your search service. For more information, see [Collect and analyze log data](search-monitor-logs.md).
23
23
24
24
## Identify relevant search data
25
25
26
-
To have useful search metrics, it's necessary to log some signals from the users of the search application. These signals signify content that users are interested in and that they consider relevant.
27
-
28
-
Two signals are needed for search traffic analytics:
26
+
To have useful search metrics, it's necessary to log some signals from the users of your search application. These signals signify content that users are interested in and that they consider relevant. For search traffic analytics, these include:
29
27
30
28
+ User-generated search events: Only search queries initiated by a user are interesting. Search requests used to populate facets, additional content or any internal information, are not important and they skew and bias your results.
31
29
32
30
+ User-generated click events: On a search results page, a click event generally means that a document is a relevant result for a specific search query.
33
31
34
-
By linking search and click events with a correlation ID, you'll gain a deeper understanding of how well your application's search functionality is performing.
32
+
By linking search and click events with a correlation ID, you'll gain a deeper understanding of how well your application's search functionality is performing.
35
33
36
34
## Add search traffic analytics
37
35
38
-
The signals mentioned in the preceding section must be gathered from the search application as the user interacts with it. Application Insights is an extensible monitoring solution, available for multiple platforms, with flexible instrumentation options. Usage of Application Insights lets you take advantage of the Power BI search reports created by Azure Cognitive Search to make the analysis of data easier.
39
-
40
-
In the [portal](https://portal.azure.com) page for your Azure Cognitive Search service, the Search Traffic Analytics page contains a cheat sheet for following this telemetry pattern. You can also select or create an Application Insights resource, and see the necessary data, all in one place.
36
+
In the [portal](https://portal.azure.com) page for your Azure Cognitive Search service, the Search Traffic Analytics page contains a cheat sheet for following this telemetry pattern. From this page, you can select or create an Application Insights resource, and see the necessary data, all in one place.
41
37
42
38

43
39
@@ -53,7 +49,7 @@ You'll need the instrumentation key for creating the telemetry client for your a
53
49
54
50
1. Click **Get Started**.
55
51
56
-
1. Register your app by providing a Microsoft account, Azure subscription, and an Application Insights resource (new is the default). Click **Register**.
52
+
1. Register your app by providing a Microsoft account, Azure subscription, and an Application Insights resource (a new resource is the default). Click **Register**.
57
53
58
54
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).
59
55
@@ -69,9 +65,9 @@ Server-side telemetry captures metrics at the application layer, for example in
69
65
70
66
On the client, you might have additional code that manipulates query inputs, adds navigation, or includes context (for example, queries initiated from a home page versus a product page). If this describes your solution, you might opt for client-side instrumentation so that your telemetry reflects the additional detail.
71
67
72
-
**Using C#**
68
+
**Use C#**
73
69
74
-
Depending on the approach used to register your app, the **InstrumentationKey** is in appsettings.json if your project is ASP.NET. Refer back to the registration instruction if you want to double-check the key location.
70
+
Depending on the approach used to register your app, the **InstrumentationKey** is in appsettings.json if your project is ASP.NET. Refer back to the registration instructions if you are unsure of the key location.
75
71
76
72
```csharp
77
73
privatestaticTelemetryClient_telemetryClient;
@@ -83,7 +79,7 @@ public HomeController(TelemetryClient telemetry)
@@ -100,7 +96,7 @@ To correlate search requests with clicks, it's necessary to have a correlation I
100
96
101
97
Having the search ID allows correlation of the metrics emitted by Azure Cognitive Search for the actual search request, with the custom metrics you are logging in Application Insights.
102
98
103
-
**Using C#**
99
+
**Use C#**
104
100
105
101
```csharp
106
102
// This sample uses the .NET SDK https://www.nuget.org/packages/Microsoft.Azure.Search
@@ -115,7 +111,7 @@ if (response.Response.Headers.TryGetValues("x-ms-azs-searchid", out headerValues
0 commit comments