Skip to content

Commit 1d5c02f

Browse files
author
Luis Cabrera
committed
Desribing optional and required fields in appsettings.json
1 parent 33b0b79 commit 1d5c02f

File tree

3 files changed

+15
-3
lines changed

3 files changed

+15
-3
lines changed

02 - Web UI Template/CognitiveSearch.UI/Search/DocumentSearchClient.cs

+2
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,8 @@ public DocumentSearchClient(IConfiguration configuration)
5656
}
5757
catch (Exception e)
5858
{
59+
// If you get an exceptio here, most likely you have not set your
60+
// credentials correctly in appsettings.json
5961
throw new ArgumentException(e.Message.ToString());
6062
}
6163
}

02 - Web UI Template/CognitiveSearch.UI/appsettings.json

+13-1
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,26 @@
66
}
77
},
88

9+
// Required fields
910
"SearchServiceName": "",
1011
"SearchApiKey": "",
1112
"SearchIndexName": "",
12-
"InstrumentationKey": "",
1313
"StorageAccountName": "",
1414
"StorageAccountKey": "",
1515
"StorageContainerAddress": "https://{storage-account-name}.blob.core.windows.net/{container-name}",
1616
"KeyField": "metadata_storage_path",
1717
"IsPathBase64Encoded": true,
18+
19+
// Optional instrumentation key
20+
"InstrumentationKey": "",
21+
22+
// Optional container addresses if using more than one indexer:
23+
"StorageContainerAddress2": "https://{storage-account-name}.blob.core.windows.net/{container-name}",
24+
"StorageContainerAddress3": "https://{storage-account-name}.blob.core.windows.net/{container-name}",
25+
26+
// Optional key to an Azure Maps account if you would like to display the geoLocation field in a map
27+
"AzureMapsSubscriptionKey": "",
28+
29+
// Set to the name of a facetable field you would like to represent as a graph
1830
"GraphFacet": "keyPhrases"
1931
}

02 - Web UI Template/CognitiveSearch.UI/wwwroot/js/results.js

-2
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,6 @@ function UpdateResults(data) {
4242
path = result.metadata_storage_path;
4343
}
4444

45-
path = path;
46-
4745
if (result["metadata_storage_name"] !== undefined) {
4846
name = result.metadata_storage_name.split(".")[0];
4947
}

0 commit comments

Comments
 (0)