Skip to content

Commit 0a1525a

Browse files
committed
Formatting, next round
1 parent f715457 commit 0a1525a

File tree

3 files changed

+15
-19
lines changed

3 files changed

+15
-19
lines changed
3.25 KB
Loading
1.39 KB
Loading

articles/search/search-traffic-analytics.md

Lines changed: 15 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
title: Search traffic telemetry data
2+
title: Telemetry for search traffic analytics
33
titleSuffix: Azure Cognitive Search
44
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.
55

@@ -16,28 +16,24 @@ ms.date: 03/18/2020
1616

1717
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.
1818

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.
2020

2121
> [!NOTE]
2222
> 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).
2323
2424
## Identify relevant search data
2525

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:
2927

3028
+ 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.
3129

3230
+ 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.
3331

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.
3533

3634
## Add search traffic analytics
3735

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.
4137

4238
![Search Traffic Analytics page in the portal](media/search-traffic-analytics/azuresearch-trafficanalytics.png "Search Traffic Analytics page in the portal")
4339

@@ -53,7 +49,7 @@ You'll need the instrumentation key for creating the telemetry client for your a
5349

5450
1. Click **Get Started**.
5551

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**.
5753

5854
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).
5955

@@ -69,9 +65,9 @@ Server-side telemetry captures metrics at the application layer, for example in
6965

7066
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.
7167

72-
**Using C#**
68+
**Use C#**
7369

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.
7571

7672
```csharp
7773
private static TelemetryClient _telemetryClient;
@@ -83,7 +79,7 @@ public HomeController(TelemetryClient telemetry)
8379
}
8480
```
8581

86-
**Using JavaScript**
82+
**Use JavaScript**
8783

8884
```javascript
8985
<script type="text/javascript">var appInsights=window.appInsights||function(config){function r(config){t[config]=function(){var i=arguments;t.queue.push(function(){t[config].apply(t,i)})}}var t={config:config},u=document,e=window,o="script",s=u.createElement(o),i,f;s.src=config.url||"//az416426.vo.msecnd.net/scripts/a/ai.0.js";u.getElementsByTagName(o)[0].parentNode.appendChild(s);try{t.cookie=u.cookie}catch(h){}for(t.queue=[],i=["Event","Exception","Metric","PageView","Trace","Dependency"];i.length;)r("track"+i.pop());return r("setAuthenticatedUserContext"),r("clearAuthenticatedUserContext"),config.disableExceptionTracking||(i="onerror",r("_"+i),f=e[i],e[i]=function(config,r,u,e,o){var s=f&&f(config,r,u,e,o);return s!==!0&&t["_"+i](config,r,u,e,o),s}),t}
@@ -100,7 +96,7 @@ To correlate search requests with clicks, it's necessary to have a correlation I
10096

10197
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.
10298

103-
**Using C#**
99+
**Use C#**
104100

105101
```csharp
106102
// 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
115111
}
116112
```
117113

118-
**Using JavaScript (calling REST APIs)**
114+
**Use JavaScript (calling REST APIs)**
119115

120116
```javascript
121117
request.setRequestHeader("x-ms-azs-return-searchid", "true");
@@ -138,7 +134,7 @@ Every time that a search request is issued by a user, you should log that as a s
138134
> Request the count of user generated queries by adding $count=true to your search query. For more information, see [Search Documents (REST)](/rest/api/searchservice/search-documents#counttrue--false).
139135
>
140136

141-
**Using C#**
137+
**Use C#**
142138

143139
```csharp
144140
var properties = new Dictionary <string, string> {
@@ -152,7 +148,7 @@ var properties = new Dictionary <string, string> {
152148
_telemetryClient.TrackEvent("Search", properties);
153149
```
154150

155-
**Using JavaScript**
151+
**Use JavaScript**
156152

157153
```javascript
158154
appInsights.trackEvent("Search", {
@@ -178,7 +174,7 @@ Every time that a user clicks on a document, that's a signal that must be logged
178174
> Position refers to the cardinal order in your application. You are free to set this number, as long as it's always the same, to allow for comparison.
179175
>
180176

181-
**Using C#**
177+
**Use C#**
182178

183179
```csharp
184180
var properties = new Dictionary <string, string> {
@@ -190,7 +186,7 @@ var properties = new Dictionary <string, string> {
190186
_telemetryClient.TrackEvent("Click", properties);
191187
```
192188

193-
**Using JavaScript**
189+
**Use JavaScript**
194190

195191
```javascript
196192
appInsights.trackEvent("Click", {

0 commit comments

Comments
 (0)