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
Note your **Search resource name**. You'll need this to connect the Azure Function app to your Search resource.
9
+
10
+
> [!CAUTION]
11
+
> While you may be tempted to use your Search admin key in the Azure Function, that isn't following the principle of least privilege. The Azure Function will use the query key to conform to least privilege.
Once the upload completes, the Search Index is ready to use. Review your new Index.
10
+
11
+
1. In Visual Studio Code, open the Azure Cognitive Search extension and select your Search resource.
12
+
13
+
:::image type="content" source="../media/tutorial-javascript-create-load-index/visual-studio-code-search-extension-view-resource.png" alt-text="In Visual Studio Code, open the Azure Cognitive Search extension and open your Search resource.":::
14
+
15
+
1. Expand Indexes, then Documents, then `good-books`, then select a doc to see all the document-specific data.
16
+
17
+
:::image type="content" source="../media/tutorial-javascript-create-load-index/visual-studio-code-search-extension-view-docs.png" lightbox="../media/tutorial-javascript-create-load-index/visual-studio-code-search-extension-view-docs.png" alt-text="Expand Indexes, then `good-books`, then select a doc.":::
Use the following git command in the VS Code integrated terminal at the `bulk-insert` directory, to roll back the changes. They aren't needed to continue the tutorial and you shouldn't save or push these secrets to your repo.
Copy file name to clipboardExpand all lines: articles/search/tutorial-csharp-create-load-index.md
+16-13Lines changed: 16 additions & 13 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -7,16 +7,17 @@ author: diberry
7
7
ms.author: diberry
8
8
ms.service: cognitive-search
9
9
ms.topic: tutorial
10
-
ms.date: 08/30/2022
10
+
ms.date: 11/01/2022
11
11
ms.custom: devx-track-csharp
12
12
ms.devlang: csharp
13
13
---
14
14
15
15
# 2 - Create and load Search Index with .NET
16
16
17
17
Continue to build your Search-enabled website by:
18
-
* Creating a Search resource with the VS Code extension
19
-
* Creating a new index and importing data with .NET using the sample script and Azure SDK [Azure.Search.Documents](https://www.nuget.org/packages/Azure.Search.Documents/).
18
+
* Create a Search resource with the VS Code extension
19
+
* Create a new index
20
+
* Import data with .NET using the sample script and Azure SDK [Azure.Search.Documents](https://www.nuget.org/packages/Azure.Search.Documents/).
20
21
21
22
## Create an Azure Search resource
22
23
@@ -26,7 +27,7 @@ Create a new Search resource with the [Azure Cognitive Search](https://marketpla
26
27
27
28
1. In the Side bar, **right-click on your Azure subscription** under the `Azure: Cognitive Search` area and select **Create new search service**.
28
29
29
-
:::image type="content" source="./media/tutorial-javascript-create-load-index/visual-studio-code-create-search-resource.png" alt-text="In the Side bar, right-click on your Azure subscription under the **Azure: Cognitive Search** area and select **Create new search service**.":::
30
+
:::image type="content" source="./media/tutorial-javascript-create-load-index/visual-studio-code-create-search-resource.png" alt-text="Screenshot of Visual Studio code showing the Azure explorer bar, right-click on your Azure subscription under the Azure: Cognitive Search area and select Create new search service.":::
30
31
31
32
1. Follow the prompts to provide the following information:
32
33
@@ -45,7 +46,7 @@ Get your Search resource admin key with the Visual Studio Code extension.
45
46
46
47
1. In Visual Studio Code, in the Side bar, right-click on your Search resource and select **Copy Admin Key**.
47
48
48
-
:::image type="content" source="./media/tutorial-javascript-create-load-index/visual-studio-code-copy-admin-key.png" alt-text="In the Side bar, right-click on your Search resource and select **Copy Admin Key**.":::
49
+
:::image type="content" source="./media/tutorial-javascript-create-load-index/visual-studio-code-copy-admin-key.png" alt-text="Screenshot of Visual Studio code showing the Azure explorer bar, right-click on your Search resource and select Copy Admin Key.":::
49
50
50
51
1. Keep this admin key, you will need to use it in [a later section](#prepare-the-bulk-import-script-for-search).
51
52
@@ -86,11 +87,19 @@ Once the upload completes, the Search Index is ready to use. Review your new Ind
86
87
87
88
1. In Visual Studio Code, open the Azure Cognitive Search extension and select your Search resource.
88
89
89
-
:::image type="content" source="media/tutorial-javascript-create-load-index/visual-studio-code-search-extension-view-resource.png" alt-text="In Visual Studio Code, open the Azure Cognitive Search extension and open your Search resource.":::
90
+
:::image type="content" source="media/tutorial-javascript-create-load-index/visual-studio-code-search-extension-view-resource.png" alt-text="Screenshot of Visual Studio Code, open the Azure Cognitive Search extension and open your Search resource.":::
90
91
91
92
1. Expand Indexes, then Documents, then `good-books`, then select a doc to see all the document-specific data.
92
93
93
-
:::image type="content" source="media/tutorial-javascript-create-load-index/visual-studio-code-search-extension-view-docs.png" lightbox="media/tutorial-javascript-create-load-index/visual-studio-code-search-extension-view-docs.png" alt-text="Expand Indexes, then `good-books`, then select a doc.":::
94
+
:::image type="content" source="media/tutorial-javascript-create-load-index/visual-studio-code-search-extension-view-docs.png" lightbox="media/tutorial-javascript-create-load-index/visual-studio-code-search-extension-view-docs.png" alt-text="Screenshot of Visual Studio Code showing Cognitive Search resource, expand Indexes, then `good-books`, then select a doc.":::
95
+
96
+
## Rollback bulk import file changes
97
+
98
+
Use the following git command in the VS Code integrated terminal at the `bulk-insert` directory, to rollback the changes. They are not needed to continue the tutorial and you shouldn't save or push these secrets to your repo.
99
+
100
+
```git
101
+
git checkout .
102
+
```
94
103
95
104
## Copy your Search resource name
96
105
@@ -99,13 +108,7 @@ Note your **Search resource name**. You will need this to connect the Azure Func
99
108
> [!CAUTION]
100
109
> While you may be tempted to use your Search admin key in the Azure Function, that isn't following the principle of least privilege. The Azure Function will use the query key to conform to least privilege.
101
110
102
-
## Rollback bulk import file changes
103
-
104
-
Use the following git commandin the VS Code integrated terminal at the `bulk-insert` directory, to rollback the changes. They are not needed to continue the tutorial and you shouldn't save or push these secrets to your repo.
This sample website provides access to a catalog of 10,000 books. A user can search the catalog by entering text in the search bar. While the user enters text, the website uses the search index's suggest feature to complete the text. Once the query finishes, the list of books is displayed with a portion of the details. A user can select a book to see all the details, stored in the search index, of the book.
26
-
27
-
:::image type="content" source="./media/tutorial-javascript-overview/cognitive-search-enabled-book-website.png" alt-text="This sample website provides access to a catalog of 10,000 books. A user can search the catalog by entering text in the search bar. While the user enters text, the website uses the search index's suggest feature to complete the text. Once the search finishes, the list of books is displayed with a portion of the details. A user can select a book to see all the details, stored in the search index, of the book.":::
28
-
29
-
The search experience includes:
30
-
31
-
* Search – provides search functionality for the application.
32
-
* Suggest – provides suggestions as the user is typing in the search bar.
33
-
* Document Lookup – looks up a document by ID to retrieve all of its contents for the details page.
The [sample](https://github.com/Azure-Samples/azure-search-dotnet-samples/tree/master/search-website) includes the following:
28
+
The [sample](https://github.com/Azure-Samples/azure-search-dotnet-samples/tree/master/search-website-functions-v4) includes the following:
38
29
39
30
|App|Purpose|GitHub<br>Repository<br>Location|
40
31
|--|--|--|
41
-
|Client|React app (presentation layer) to display books, with search. It calls the Azure Function app. |[/search-website/src](https://github.com/Azure-Samples/azure-search-dotnet-samples/tree/master/search-website/src)|
42
-
|Server|Azure .NET Function app (business layer) - calls the Azure Cognitive Search API using .NET SDK |[/search-website/api](https://github.com/Azure-Samples/azure-search-dotnet-samples/tree/master/search-website/api)|
43
-
|Bulk insert|.NET file to create the index and add documents to it.|[/search-website/bulk-insert](https://github.com/Azure-Samples/azure-search-dotnet-samples/tree/master/search-website/bulk-insert)|
32
+
|Client|React app (presentation layer) to display books, with search. It calls the Azure Function app. |[/search-website-functions-v4/](https://github.com/Azure-Samples/azure-search-dotnet-samples/tree/master/search-website-functions-v4/client)|
33
+
|Server|Azure .NET Function app (business layer) - calls the Azure Cognitive Search API using .NET SDK |[/search-website-functions-v4/api](https://github.com/Azure-Samples/azure-search-dotnet-samples/tree/master/search-website-functions-v4/api)|
34
+
|Bulk insert|.NET file to create the index and add documents to it.|[/search-website-functions-v4/bulk-insert](https://github.com/Azure-Samples/azure-search-dotnet-samples/tree/master/search-website-functions-v4/bulk-insert)|
44
35
45
36
## Set up your development environment
46
37
47
38
Install the following for your local development environment.
-[Azure Static Web App](https://marketplace.visualstudio.com/items?itemName=ms-azuretools.vscode-azurestaticwebapps)
55
45
- Optional:
@@ -63,27 +53,11 @@ Forking the sample repository is critical to be able to deploy the Static Web Ap
63
53
64
54
Complete the fork process in your web browser with your GitHub account. This tutorial uses your fork as part of the deployment to an Azure Static Web App.
65
55
66
-
1. At a bash terminal, download the sample application to your local computer.
67
-
68
-
Replace `YOUR-GITHUB-ALIAS` with your GitHub alias.
1. In Visual Studio Code, open your local folder of the cloned repository. The remaining tasks are accomplished from Visual Studio Code, unless specified.
Copy file name to clipboardExpand all lines: articles/search/tutorial-javascript-create-load-index.md
+3-18Lines changed: 3 additions & 18 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -83,30 +83,15 @@ The script uses the Azure SDK for Cognitive Search:
83
83
84
84
## Review the new Search Index
85
85
86
-
Once the upload completes, the Search Index is ready to use. Review your new Index.
87
-
88
-
1. In Visual Studio Code, open the Azure Cognitive Search extension and select your Search resource.
89
-
90
-
:::image type="content" source="media/tutorial-javascript-create-load-index/visual-studio-code-search-extension-view-resource.png" alt-text="In Visual Studio Code, open the Azure Cognitive Search extension and open your Search resource.":::
91
-
92
-
1. Expand Indexes, then Documents, then `good-books`, then select a doc to see all the document-specific data.
93
-
94
-
:::image type="content" source="media/tutorial-javascript-create-load-index/visual-studio-code-search-extension-view-docs.png" lightbox="media/tutorial-javascript-create-load-index/visual-studio-code-search-extension-view-docs.png" alt-text="Expand Indexes, then `good-books`, then select a doc.":::
Use the following git command in the VS Code integrated terminal at the `bulk-insert` directory, to roll back the changes. They aren't needed to continue the tutorial and you shouldn't save or push these secrets to your repo.
Note your **Search resource name**. You'll need this to connect the Azure Function app to your Search resource.
107
-
108
-
> [!CAUTION]
109
-
> While you may be tempted to use your Search admin key in the Azure Function, that isn't following the principle of least privilege. The Azure Function will use the query key to conform to least privilege.
0 commit comments