@@ -240,14 +240,14 @@ client.resetIndexer('myindexer', function(err){
240
240
});
241
241
` ` `
242
242
243
- It is also possible to work with the (currently in preview) synonym maps :
243
+ It is also possible to work with Synonym Maps :
244
244
245
245
` ` ` js
246
246
var client = require (' azure-search' )({
247
247
url: ' https://xxx.search.windows.net' ,
248
248
key: ' your key goes here' ,
249
249
// Mandatory in order to enable preview support of synonyms
250
- version: ' 2016-09-01-Preview '
250
+ version: ' 2017-11-11 '
251
251
})
252
252
253
253
var schema = {
@@ -280,6 +280,55 @@ client.deleteSynonymMap('mysynonmap', function (err) {
280
280
});
281
281
` ` `
282
282
283
+ It is also possible to work with Skillsets for Cognitive Search, currently in preview version '2017-11-11-Preview':
284
+
285
+ ` ` ` js
286
+ var client = require (' azure-search' )({
287
+ url: ' https://xxx.search.windows.net' ,
288
+ key: ' your key goes here' ,
289
+ // Mandatory in order to enable preview support of skillsets
290
+ version: ' 2017-11-11-Preview'
291
+ })
292
+
293
+ var schema = {
294
+ name: ' myskillset' , // Required for using the POST method
295
+ description: ' My skillset description' , // Optional
296
+ skills: [{ // Required array of skills
297
+ ' @odata.type' : ' #Microsoft.Skills.Text.SentimentSkill' ,
298
+ inputs: [{
299
+ name: ' text' ,
300
+ source: ' /document/content'
301
+ }],
302
+ outputs: [{
303
+ name: ' score' ,
304
+ targetName: ' myScore'
305
+ }]
306
+ }]
307
+ }
308
+
309
+ client .createSkillset (schema, function (err , data ) {
310
+ // optional error or the created skillset data
311
+ });
312
+
313
+ client .updateOrCreateSkillset (' myskillset' , schema, function (err , data ) {
314
+ // optional error or
315
+ // when updating - data is empty
316
+ // when creating - data would contain the created skillset data
317
+ });
318
+
319
+ client .getSkillset (' myskillset' , function (err , data ) {
320
+ // optional error or the skillset data
321
+ });
322
+
323
+ client .listSkillsets (function (err , maps ) {
324
+ // optional error or the list of skillsets defined under the account
325
+ })
326
+
327
+ client .deleteSynonymMap (' myskillset' , function (err ) {
328
+ // optional error
329
+ });
330
+ ` ` `
331
+
283
332
### Accessing the Raw Response
284
333
285
334
The raw response body is always returned as the 3rd argument in the callback.
0 commit comments