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/cognitive-search-tutorial-blob-dotnet.md
+19-83Lines changed: 19 additions & 83 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -8,7 +8,7 @@ author: MarkHeff
8
8
ms.author: maheff
9
9
ms.service: cognitive-search
10
10
ms.topic: tutorial
11
-
ms.date: 02/27/2020
11
+
ms.date: 05/05/2020
12
12
---
13
13
14
14
# Tutorial: AI-generated searchable content from Azure blobs using the .NET SDK
@@ -39,7 +39,9 @@ If you don't have an Azure subscription, open a [free account](https://azure.mic
39
39
40
40
1. Open this [OneDrive folder](https://1drv.ms/f/s!As7Oy81M_gVPa-LCb5lC_3hbS-4) and on the top-left corner, click **Download** to copy the files to your computer.
41
41
42
-
1. Right-click the zip file and select **Extract All**. There are 14 files of various types. Use all of them for this tutorial.
42
+
1. Right-click the zip file and select **Extract All**. There are 14 files of various types. You'll use 7 for this exercise.
43
+
44
+
You can also download the source code for this tutorial. Source code for this tutorial is in the tutorial-ai-enrichment folder in the [azure-search-dotnet-samples](https://github.com/Azure-Samples/azure-search-dotnet-samples) repository.
43
45
44
46
## 1 - Create services
45
47
@@ -71,9 +73,9 @@ If possible, create both in the same region and resource group for proximity and
71
73
72
74
1. Click **Blobs** service.
73
75
74
-
1. Click **+ Container** to create a container and name it *basic-demo-data-pr*.
76
+
1. Click **+ Container** to create a container and name it *cog-search-demo*.
75
77
76
-
1. Select *basic-demo-data-pr* and then click **Upload** to open the folder where you saved the download files. Select all fourteen files and click **OK** to upload.
78
+
1. Select *cog-search-demo* and then click **Upload** to open the folder where you saved the download files. Select all fourteen files and click **OK** to upload.
"AzureBlobConnectionString": "Put your Azure Blob connection string here",
164
166
}
165
167
```
166
-
168
+
167
169
Add your search service and blob storage account information. Recall that you can get this information from the service provisioning steps indicated in the previous section.
168
170
171
+
For **SearchServiceName**, enter the short service name and not the full URL.

@@ -626,33 +602,6 @@ namespace EnrichwithAI
626
602
}
627
603
```
628
604
629
-
<!-- Add the below model class definition to `DemoIndex.cs` and include it in the same namespace where you'll create the index.
630
-
631
-
```csharp
632
-
// The SerializePropertyNamesAsCamelCase attribute is defined in the Azure Cognitive Search .NET SDK.
633
-
// It ensures that Pascal-case property names in the model class are mapped to camel-case
634
-
// field names in the index.
635
-
[SerializePropertyNamesAsCamelCase]
636
-
public class DemoIndex
637
-
{
638
-
[System.ComponentModel.DataAnnotations.Key]
639
-
[IsSearchable, IsSortable]
640
-
public string Id { get; set; }
641
-
642
-
[IsSearchable]
643
-
public string Content { get; set; }
644
-
645
-
[IsSearchable]
646
-
public string LanguageCode { get; set; }
647
-
648
-
[IsSearchable]
649
-
public string[] KeyPhrases { get; set; }
650
-
651
-
[IsSearchable]
652
-
public string[] Organizations { get; set; }
653
-
}
654
-
``` -->
655
-
656
605
Now that you've defined a model class, back in `Program.cs` you can create an index definition fairly easily. The name for this index will be `demoindex`. If an index already exists with that name, it will be deleted.
657
606
658
607
```csharp
@@ -692,27 +641,14 @@ Add the following lines to `Main`.
Add the following using statement to resolve the disambiguate reference.
702
648
703
-
if (exists)
704
-
{
705
-
serviceClient.Indexes.Delete(index.Name);
706
-
}
707
-
708
-
serviceClient.Indexes.Create(index);
709
-
}
710
-
catch (Exception e)
711
-
{
712
-
// Handle exception
713
-
}
649
+
```csharp
650
+
using Index = Microsoft.Azure.Search.Models.Index;
714
651
```
715
-
-->
716
652
717
653
To learn more about defining an index, see [Create Index (Azure Cognitive Search REST API)](https://docs.microsoft.com/rest/api/searchservice/create-index).
718
654
@@ -795,7 +731,7 @@ Add the following lines to `Main`.
795
731
796
732
```csharp
797
733
// Create the indexer, map fields, and execute transformations
798
-
Console.WriteLine("Creating the indexer...");
734
+
Console.WriteLine("Creating the indexer and executing the pipeline...");
0 commit comments