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: docs/create_index_from_csv.md
+8-16Lines changed: 8 additions & 16 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,16 +1,12 @@
1
1
### Create an Azure search index from a csv file
2
2
:sparkles: Here we outline how to create an Azure search index from a CSV file summarizing funded award data exported from Reporter.nih.gov
3
3
4
-
### 1) Generate input CSV
4
+
### 1) Download input CSV
5
5
:ear: If you already have your csv ready, skip to section (2)
6
6
7
-
Our input data comes from the csv export option for [Reporter.nih.gov](https://reporter.nih.gov/). Navigate to reporter.nih.gov and select `Advanced Search`. Input your search parameters. In this case we filtered for awards made by NIGMS in FY 23. In the top right, select `Export`.
7
+
Download this public [csv file](https://www.kaggle.com/datasets/henryshan/2023-data-scientists-salary?resource=download) from kaggle to use as our input.
8
8
9
-
Select your export columns and make sure you export as a csv. In the example input data file we only selected 'Title', 'Project_ID', and 'Total_Cost', although a few other columns were also exported.
10
-
11
-

12
-
13
-
If using the UI to upload, you need to make two small edits to the csv that gets exported. First, remove the extra comma at the end of each line. Second, replace the spaces in column names in the header row. You can do this using something like Python, or just do a find/replace in a text editor.
9
+

14
10
15
11
### 2) Import data into Azure blob storage
16
12
:ear: If you already added your data to blob storage skip to section (3)
@@ -35,41 +31,37 @@ Navigate to AI Search and [create a new search](https://learn.microsoft.com/en-u
35
31
36
32

37
33
38
-
Click `Import data`
34
+
Click `Import data`.
39
35
40
36

41
37
42
38
Now fill out all the necessary parameters.
43
39
+ Data Source: Select `Azure Blob Storage`. New options will drop down.
44
-
+ Data source name: This can be anything, but go with something like `grant-data`.
40
+
+ Data source name: This can be anything, but go with something like `ds-salaries-data`.
45
41
+ Data to extract: Select `Content and metadata`.
46
42
+ Parsing mode: Select `Delimited text`. Check the `First Line Contains Header` box and leave `Delimiter Character` as `,`.
47
-
+ Delimiter Headers: Enter the comma-delimited list of column headers.
48
43
+ Connection string: Click `Choose an existing connection` and navigate to your storage account and container.
49
44
+ Managed identity authentication: Leave as default.
50
45
+ Container name: Should be populated when you connect via Connection String, but otherwise just enter your container name here.
51
46
+ Blob folder: *Optional*, if you have a folder within the container with the file(s) you want to index, enter that path here.
52
47
+ Description: *Optional*.
53
48
+ If you get errors when trying to go to the next screen, make sure you don't have trailing commas in your csv, and there are not spaces in the header names. If this happens, fix those errors, re-upload to blob storage, and then try again!
54
49
55
-

50
+

56
51
57
52
Skip ahead to `Customize target index`.
58
53
+ Give your index a name.
59
54
+ Make `Project_Number` your key.
60
55
+ Make sure the expected column names are present under fields. For the columns you expect to use, select `Retrievable` and `Searchable`. If you select all the columns you will just pay for indexing you are not using.
Navigate to `Indexes` on the left panel and wait until your index shows as many documents as you have lines in your file. It will read 0 documents until it is finished indexing. The example 500 line csv takes about one minute.
69
64
70
-

71
-
72
-
73
65
And that is it! Now return to [the tutorial notebook to run queries against this csv using GPT-4](/notebooks/GenAI/notebooks/AzureAIStudio_index_structured_with_console.ipynb).
0 commit comments