This repository has been archived by the owner on Oct 21, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 49
/
Copy pathCognitiveSearch.postman_collection.json
228 lines (228 loc) · 12.4 KB
/
CognitiveSearch.postman_collection.json
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
{
"info": {
"_postman_id": "416c98d6-6026-43eb-b0a8-bf6614832b81",
"name": "CognitiveSearch",
"schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json"
},
"item": [
{
"name": "1 - Create a data source",
"request": {
"method": "POST",
"header": [
{
"key": "api-key",
"value": "YOUR_SERVICE_API_KEY",
"type": "text"
},
{
"key": "Content-Type",
"value": "application/json",
"type": "text"
}
],
"body": {
"mode": "raw",
"raw": "{ \r\n \"name\" : \"demodata\", \r\n \"description\" : \"Demo files to demonstrate cognitive search capabilities.\", \r\n \"type\" : \"azureblob\",\r\n \"credentials\" :\r\n { \"connectionString\" :\r\n \"DefaultEndpointsProtocol=YOUR_CONNECTION_STRING\"\r\n }, \r\n \"container\" : { \"name\" : \"customskill\" }\r\n} "
},
"url": {
"raw": "https://YOUR_SERVICE_NAME.search.windows.net/datasources?api-version=2017-11-11-Preview ",
"protocol": "https",
"host": [
"YOUR_SERVICE_NAME",
"search",
"windows",
"net"
],
"path": [
"datasources"
],
"query": [
{
"key": "api-version",
"value": "2017-11-11-Preview "
}
]
}
},
"response": []
},
{
"name": "2 - Create a skillset",
"request": {
"method": "PUT",
"header": [
{
"key": "api-key",
"value": "YOUR_SERVICE_API_KEY",
"type": "text"
},
{
"key": "Content-Type",
"value": "application/json",
"type": "text"
}
],
"body": {
"mode": "raw",
"raw": "{\r\n \"description\": \r\n \"Extract entities, detect language and extract key-phrases\",\r\n \"skills\":\r\n [\r\n {\r\n \"@odata.type\": \"#Microsoft.Skills.Text.NamedEntityRecognitionSkill\",\r\n \"categories\": [ \"Organization\" ],\r\n \"defaultLanguageCode\": \"en\",\r\n \"inputs\": [\r\n {\r\n \"name\": \"text\", \"source\": \"/document/content\"\r\n }\r\n ],\r\n \"outputs\": [\r\n {\r\n \"name\": \"organizations\", \"targetName\": \"organizations\"\r\n }\r\n ]\r\n },\r\n {\r\n \"@odata.type\": \"#Microsoft.Skills.Text.LanguageDetectionSkill\",\r\n \"inputs\": [\r\n {\r\n \"name\": \"text\", \"source\": \"/document/content\"\r\n }\r\n ],\r\n \"outputs\": [\r\n {\r\n \"name\": \"languageCode\",\r\n \"targetName\": \"languageCode\"\r\n }\r\n ]\r\n },\r\n {\r\n \"@odata.type\": \"#Microsoft.Skills.Text.SplitSkill\",\r\n \"textSplitMode\" : \"pages\", \r\n \"maximumPageLength\": 1000,\r\n \"inputs\": [\r\n {\r\n \"name\": \"text\",\r\n \"source\": \"/document/content\"\r\n },\r\n { \r\n \"name\": \"languageCode\",\r\n \"source\": \"/document/languageCode\"\r\n }\r\n ],\r\n \"outputs\": [\r\n {\r\n \"name\": \"textItems\",\r\n \"targetName\": \"pages\"\r\n }\r\n ]\r\n },\r\n {\r\n \"@odata.type\": \"#Microsoft.Skills.Text.KeyPhraseExtractionSkill\",\r\n \"context\": \"/document/pages/*\",\r\n \"inputs\": [\r\n {\r\n \"name\": \"text\", \"source\": \"/document/pages/*\"\r\n },\r\n {\r\n \"name\":\"languageCode\", \"source\": \"/document/languageCode\"\r\n }\r\n ],\r\n \"outputs\": [\r\n {\r\n \"name\": \"keyPhrases\",\r\n \"targetName\": \"keyPhrases\"\r\n }\r\n ]\r\n },\r\n {\r\n \"@odata.type\": \"#Microsoft.Skills.Custom.WebApiSkill\",\r\n \"description\": \"Our new custom skill for custom list generator\",\r\n \"uri\": \"https://YOUR_FUNCTION_NAME.azurewebsites.net/api/CustomListExtract?code=YOUR_SERVICE_CODE\",\r\n \"batchSize\":1,\r\n \"context\": \"/document\",\r\n \"inputs\": [\r\n {\r\n \"name\": \"text\",\r\n \"source\": \"/document/content\"\r\n }\r\n ],\r\n \"outputs\": [\r\n {\r\n \"name\": \"termList\",\r\n \"targetName\": \"termList\"\r\n },\r\n {\r\n \"name\": \"productList\",\r\n \"targetName\": \"productList\"\r\n }\r\n ]\r\n }\r\n ]\r\n}"
},
"url": {
"raw": "https://YOUR_SERVICE_NAME.search.windows.net/skillsets/customlistskillset?api-version=2017-11-11-Preview",
"protocol": "https",
"host": [
"YOUR_SERVICE_NAME",
"search",
"windows",
"net"
],
"path": [
"skillsets",
"customlistskillset"
],
"query": [
{
"key": "api-version",
"value": "2017-11-11-Preview"
}
]
}
},
"response": []
},
{
"name": "3 - Create an index",
"request": {
"method": "PUT",
"header": [
{
"key": "api-key",
"value": "YOUR_SERVICE_API_KEY",
"type": "text"
},
{
"key": "Content-Type",
"value": "application/json",
"type": "text"
}
],
"body": {
"mode": "raw",
"raw": "{\r\n\r\n \"fields\": [\r\n {\r\n \"name\": \"id\",\r\n \"type\": \"Edm.String\",\r\n \"searchable\": true,\r\n \"filterable\": false,\r\n \"retrievable\": true,\r\n \"sortable\": true,\r\n \"facetable\": false,\r\n \"key\": true,\r\n \"indexAnalyzer\": null,\r\n \"searchAnalyzer\": null,\r\n \"analyzer\": null,\r\n \"synonymMaps\": []\r\n },\r\n {\r\n \"name\": \"content\",\r\n \"type\": \"Edm.String\",\r\n \"searchable\": true,\r\n \"filterable\": false,\r\n \"retrievable\": true,\r\n \"sortable\": false,\r\n \"facetable\": false,\r\n \"key\": false,\r\n \"indexAnalyzer\": null,\r\n \"searchAnalyzer\": null,\r\n \"analyzer\": null,\r\n \"synonymMaps\": []\r\n },\r\n {\r\n \"name\": \"languageCode\",\r\n \"type\": \"Edm.String\",\r\n \"searchable\": true,\r\n \"filterable\": false,\r\n \"retrievable\": true,\r\n \"sortable\": true,\r\n \"facetable\": false,\r\n \"key\": false,\r\n \"indexAnalyzer\": null,\r\n \"searchAnalyzer\": null,\r\n \"analyzer\": null,\r\n \"synonymMaps\": []\r\n },\r\n {\r\n \"name\": \"keyPhrases\",\r\n \"type\": \"Collection(Edm.String)\",\r\n \"searchable\": true,\r\n \"filterable\": false,\r\n \"retrievable\": true,\r\n \"sortable\": false,\r\n \"facetable\": false,\r\n \"key\": false,\r\n \"indexAnalyzer\": null,\r\n \"searchAnalyzer\": null,\r\n \"analyzer\": null,\r\n \"synonymMaps\": []\r\n },\r\n {\r\n \"name\": \"organizations\",\r\n \"type\": \"Collection(Edm.String)\",\r\n \"searchable\": true,\r\n \"filterable\": false,\r\n \"retrievable\": true,\r\n \"sortable\": false,\r\n \"facetable\": false,\r\n \"key\": false,\r\n \"indexAnalyzer\": null,\r\n \"searchAnalyzer\": null,\r\n \"analyzer\": null,\r\n \"synonymMaps\": []\r\n },\r\n {\r\n \"name\": \"termList\",\r\n \"type\": \"Collection(Edm.String)\",\r\n \"searchable\": true,\r\n \"filterable\": false,\r\n \"retrievable\": true,\r\n \"sortable\": false,\r\n \"facetable\": false,\r\n \"key\": false,\r\n \"indexAnalyzer\": null,\r\n \"searchAnalyzer\": null,\r\n \"analyzer\": null,\r\n \"synonymMaps\": []\r\n },\r\n {\r\n \"name\": \"productList\",\r\n \"type\": \"Collection(Edm.String)\",\r\n \"searchable\": true,\r\n \"filterable\": false,\r\n \"retrievable\": true,\r\n \"sortable\": false,\r\n \"facetable\": false,\r\n \"key\": false,\r\n \"indexAnalyzer\": null,\r\n \"searchAnalyzer\": null,\r\n \"analyzer\": null,\r\n \"synonymMaps\": []\r\n }\r\n ],\r\n \"scoringProfiles\": [],\r\n \"defaultScoringProfile\": null,\r\n \"corsOptions\": null,\r\n \"suggesters\": [],\r\n \"analyzers\": [],\r\n \"tokenizers\": [],\r\n \"tokenFilters\": [],\r\n \"charFilters\": []\r\n}"
},
"url": {
"raw": "https://YOUR_SERVICE_NAME.search.windows.net/indexes/customlistindex?api-version=2017-11-11-Preview",
"protocol": "https",
"host": [
"YOUR_SERVICE_NAME",
"search",
"windows",
"net"
],
"path": [
"indexes",
"customlistindex"
],
"query": [
{
"key": "api-version",
"value": "2017-11-11-Preview"
}
]
}
},
"response": []
},
{
"name": "4 - Create an indexer",
"request": {
"method": "PUT",
"header": [
{
"key": "api-key",
"type": "text",
"value": "YOUR_SERVICE_API_KEY"
},
{
"key": "Content-Type",
"type": "text",
"value": "application/json"
}
],
"body": {
"mode": "raw",
"raw": "{\r\n \"name\":\"customlistindexer\",\t\r\n \"dataSourceName\" : \"demodata\",\r\n \"targetIndexName\" : \"customlistindex\",\r\n \"skillsetName\" : \"customlistskillset\",\r\n \"fieldMappings\" : [\r\n {\r\n \"sourceFieldName\" : \"metadata_storage_path\",\r\n \"targetFieldName\" : \"id\",\r\n \"mappingFunction\" : \r\n { \"name\" : \"base64Encode\" }\r\n },\r\n {\r\n \"sourceFieldName\" : \"content\",\r\n \"targetFieldName\" : \"content\"\r\n }\r\n ],\r\n \"outputFieldMappings\" : \r\n [\r\n {\r\n \"sourceFieldName\" : \"/document/organizations\", \r\n \"targetFieldName\" : \"organizations\"\r\n },\r\n {\r\n \"sourceFieldName\" : \"/document/pages/*/keyPhrases/*\", \r\n \"targetFieldName\" : \"keyPhrases\"\r\n },\r\n {\r\n \"sourceFieldName\": \"/document/languageCode\",\r\n \"targetFieldName\": \"languageCode\"\r\n },\r\n {\r\n \"sourceFieldName\": \"/document/termList\",\r\n \"targetFieldName\": \"termList\"\r\n },\r\n {\r\n \"sourceFieldName\": \"/document/productList\",\r\n \"targetFieldName\": \"productList\"\r\n } \r\n ],\r\n \"parameters\":\r\n {\r\n \t\"maxFailedItems\":-1,\r\n \t\"maxFailedItemsPerBatch\":-1,\r\n \t\"configuration\": \r\n {\r\n \t\"dataToExtract\": \"contentAndMetadata\",\r\n \t\"imageAction\": \"generateNormalizedImages\"\r\n\t\t}\r\n }\r\n}"
},
"url": {
"raw": "https://YOUR_SERVICE_NAME.search.windows.net/indexers/customlistindexer?api-version=2017-11-11-Preview",
"protocol": "https",
"host": [
"YOUR_SERVICE_NAME",
"search",
"windows",
"net"
],
"path": [
"indexers",
"customlistindexer"
],
"query": [
{
"key": "api-version",
"value": "2017-11-11-Preview"
}
]
}
},
"response": []
},
{
"name": "5 - Verify Content",
"request": {
"method": "GET",
"header": [
{
"key": "api-key",
"value": "YOUR_SERVICE_API_KEY",
"type": "text"
},
{
"key": "Content-Type",
"value": "application/json",
"type": "text"
}
],
"body": {
"mode": "raw",
"raw": ""
},
"url": {
"raw": "https://YOUR_SERVICE_NAME.search.windows.net/indexes/customlistindex/docs?search=*&api-version=2017-11-11-Preview",
"protocol": "https",
"host": [
"YOUR_SERVICE_NAME",
"search",
"windows",
"net"
],
"path": [
"indexes",
"customlistindex",
"docs"
],
"query": [
{
"key": "search",
"value": "*"
},
{
"key": "api-version",
"value": "2017-11-11-Preview"
}
]
}
},
"response": []
}
]
}