Skip to content

Commit 1e7fdb0

Browse files
committed
Best effort freshness on search traffic analytics
1 parent 7d515a0 commit 1e7fdb0

7 files changed

+23
-20
lines changed

articles/search/includes/tutorial-add-search-website-create-app.md

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,20 @@
11
---
22
ms.topic: include
3-
ms.date: 09/21/2023
3+
ms.date: 04/25/2024
44
author: HeidiSteen
55
ms.author: heidist
66
ms.service: cognitive-search
77
ms.custom:
88
- ignite-2023
99
---
1010

11-
Deploy the search-enabled website as an Azure Static Web Apps site. This deployment includes both the React app and the Function app.
11+
Deploy the search-enabled website as an Azure Static Web Apps site. This deployment includes both the React app for the web pages, and the Function app for search operations.
1212

1313
The static web app pulls the information and files for deployment from GitHub using your fork of the samples repository.
1414

1515
## Create a Static Web App in Visual Studio Code
1616

17-
1. In Visual Studio Code, open a folder at the repository root (for example, `azure-search-javascript-samples`).
17+
1. In Visual Studio Code, make sure you're at the repository root, and not the bulk-insert folder (for example, `azure-search-javascript-samples`).
1818

1919
1. Select **Azure** from the Activity Bar, then open **Resources** from the side bar.
2020

@@ -40,7 +40,7 @@ The static web app pulls the information and files for deployment from GitHub us
4040
|Select a location for new resources. | For Node.js: Select `West US 2` during the Azure Function programming model (PM) v4 preview. For C# and Python, select a region near you. |
4141
|Choose build preset to configure default project structure. |Select **Custom**. |
4242
|Select the location of your client application code | `search-website-functions-v4/client`<br><br>This is the path, from the root of the repository, to your static web app. |
43-
|Select the location of your Azure Functions code | `search-website-functions-v4/api`<br><br>This is the path, from the root of the repository, to your static web app. If there are no other functions in the repository, you won't be prompted for the function code location. Currently, you'll need to perform extra steps to ensure the function code location is correct. These steps are performed after the resource is created and are documented in this article. |
43+
|Select the location of your Azure Functions code | `search-website-functions-v4/api`<br><br>This is the path, from the root of the repository, to your static web app. If there are no other functions in the repository, you won't be prompted for the function code location. *Currently, you'll need to perform extra steps to ensure the function code location is correct. These steps are performed after the resource is created and are documented in this article.* |
4444
|Enter the path of your build output... | `build`<br><br>This is the path, from your static web app, to your generated files.|
4545

4646
If you get an error about an incorrect region, make sure the resource group and static web app resource are in one of the supported regions listed in the error response.
@@ -55,7 +55,7 @@ The static web app pulls the information and files for deployment from GitHub us
5555

5656
:::image type="content" source="../media/tutorial-javascript-static-web-app/visual-studio-code-azure-activity-log.png" alt-text="Screenshot of the Activity Log in Visual Studio Code." border="true":::
5757

58-
1. Currently, the YML file is created with erroneous path syntax for the Azure function code. Use this workaround to correct the syntax. You can perform this step as soon as the YML file is created. A new workflow will launch as soon as you push the updates:
58+
1. *Currently, the YML file is created with erroneous path syntax for the Azure function code*. Use this workaround to correct the syntax and rerun the workflow. You can perform this step as soon as the YML file is created. A new workflow launches as soon as you push the updates:
5959

6060
1. In Visual Studio Code explorer, open the `./.github/workflows/` directory.
6161

@@ -113,7 +113,7 @@ The static web app pulls the information and files for deployment from GitHub us
113113

114114
1. Keep this query key to use in the next section. The query key authorizes read access to a search index.
115115

116-
## Add configuration settings in Azure portal
116+
## Add environment variables in Azure portal
117117

118118
The Azure Function app won't return search data until the search secrets are in settings.
119119

@@ -122,9 +122,9 @@ The Azure Function app won't return search data until the search secrets are in
122122

123123
:::image type="content" source="../media/tutorial-javascript-static-web-app/open-static-web-app-in-azure-portal.png" alt-text="Screenshot of Visual Studio Code showing Azure Static Web Apps explorer with the Open in Portal option shown.":::
124124

125-
1. Select **Configuration** then select **+ Add**.
125+
1. Select **Environment variables** then select **+ Add application setting**.
126126

127-
:::image type="content" source="../media/tutorial-javascript-static-web-app/add-new-application-setting-to-static-web-app-in-portal.png" alt-text="Screenshot of Visual Studio Code showing the Azure Static Web Apps explorer with the Configuration option shown.":::
127+
:::image type="content" source="../media/tutorial-javascript-static-web-app/add-new-application-setting-to-static-web-app-in-portal.png" alt-text="Screenshot of the static web app's environment variables page in the Azure portal.":::
128128

129129
1. Add each of the following settings:
130130

@@ -137,7 +137,7 @@ The Azure Function app won't return search data until the search secrets are in
137137

138138
Azure AI Search requires different syntax for filtering collections than it does for strings. Add a `*` after a field name to denote that the field is of type `Collection(Edm.String)`. This allows the Azure Function to add filters correctly to queries.
139139

140-
1. Select **Save** to save the settings.
140+
1. Check your settings to make sure they look like the following screenshot.
141141

142142
:::image type="content" source="../media/tutorial-javascript-static-web-app/save-new-application-setting-to-static-web-app-in-portal.png" alt-text="Screenshot of browser showing Azure portal with the button to save the settings for your app.":::
143143

@@ -147,6 +147,8 @@ The Azure Function app won't return search data until the search secrets are in
147147

148148
:::image type="content" source="../media/tutorial-javascript-static-web-app/visual-studio-code-extension-fresh-resource-2.png" alt-text="Screenshot of Visual Studio Code showing the Azure Static Web Apps explorer with the new application settings." border="true":::
149149

150+
If you don't see the application settings, revisit the steps for updating and relaunching the GitHub workflow.
151+
150152
## Use search in your static web app
151153

152154
1. In Visual Studio Code, open the [Activity bar](https://code.visualstudio.com/docs/getstarted/userinterface), and select the Azure icon.
Loading
Loading

articles/search/search-traffic-analytics.md

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ ms.author: heidist
88

99
ms.service: cognitive-search
1010
ms.topic: conceptual
11-
ms.date: 04/25/2024
11+
ms.date: 05/26/2023
1212
ms.custom:
1313
- devx-track-csharp
1414
- ignite-2023
@@ -80,24 +80,25 @@ var telemetryClient = new TelemetryClient();
8080
telemetryClient.InstrumentationKey = "0000000000000000000000000000";
8181
```
8282

83-
### Request a Search ID for correlation
83+
<!-- ### Request a Search ID for correlation
84+
85+
> [!IMPORTANT]
86+
> In the Azure portal, the snippets for request headers are made using an outdated version of the Azure SDK. Updates are pending.
8487
8588
To correlate search requests with clicks, it's necessary to have a correlation ID that relates these two distinct events. Azure AI Search provides you with a search ID when you request it with an HTTP header.
8689
8790
Having the search ID allows correlation of the metrics emitted by Azure AI Search for the request itself, with the custom metrics you're logging in Application Insights.
8891
8992
```csharp
90-
// Azure Search .NET SDK https://www.nuget.org/packages/Microsoft.Azure.Search
91-
92-
var client = new SearchIndexClient(<SEARCH SERVICE NAME>, <INDEX NAME>, new SearchCredentials(<QUERY KEY>))
93+
var client = new SearchClient(<SEARCH SERVICE NAME>, <INDEX NAME>, new AzureDefaultCredentials())
9394
var headers = new Dictionary<string, List<string>>() { { "x-ms-azs-return-searchid", new List<string>() { "true" } } };
9495
var response = await client.Documents.SearchWithHttpMessagesAsync(searchText: searchText, searchParameters: parameters, customHeaders: headers);
9596
IEnumerable<string> headerValues;
9697
string searchId = string.Empty;
9798
if (response.Response.Headers.TryGetValues("x-ms-azs-searchid", out headerValues)){
9899
searchId = headerValues.FirstOrDefault();
99-
}
100-
```
100+
}
101+
```-->
101102

102103
### Log search events
103104

articles/search/tutorial-csharp-create-load-index.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ author: diberry
77
ms.author: diberry
88
ms.service: cognitive-search
99
ms.topic: tutorial
10-
ms.date: 07/18/2023
10+
ms.date: 04/25/2024
1111
ms.custom:
1212
- devx-track-csharp
1313
- devx-track-azurecli
@@ -17,7 +17,7 @@ ms.custom:
1717
ms.devlang: csharp
1818
---
1919

20-
# 2 - Create and load Search Index with .NET
20+
# Step 2 - Create and load Search Index with .NET
2121

2222
Continue to build your search-enabled website by following these steps:
2323
* Create a search resource

articles/search/tutorial-javascript-deploy-static-web-app.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ author: diberry
77
ms.author: diberry
88
ms.service: cognitive-search
99
ms.topic: tutorial
10-
ms.date: 09/13/2023
10+
ms.date: 04/25/2024
1111
ms.custom:
1212
- devx-track-js
1313
- ignite-2023

articles/search/tutorial-python-deploy-static-web-app.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ author: diberry
77
ms.author: diberry
88
ms.service: cognitive-search
99
ms.topic: tutorial
10-
ms.date: 07/18/2023
10+
ms.date: 04/25/2024
1111
ms.custom:
1212
- devx-track-python
1313
- ignite-2023

0 commit comments

Comments
 (0)