Skip to content

Commit 9befe27

Browse files
committed
Added skillset documentation to the readme
1 parent 8d42773 commit 9befe27

File tree

1 file changed

+51
-2
lines changed

1 file changed

+51
-2
lines changed

readme.md

Lines changed: 51 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -240,14 +240,14 @@ client.resetIndexer('myindexer', function(err){
240240
});
241241
```
242242
243-
It is also possible to work with the (currently in preview) synonym maps:
243+
It is also possible to work with Synonym Maps:
244244
245245
```js
246246
var client = require('azure-search')({
247247
url: 'https://xxx.search.windows.net',
248248
key: 'your key goes here',
249249
// Mandatory in order to enable preview support of synonyms
250-
version: '2016-09-01-Preview'
250+
version: '2017-11-11'
251251
})
252252

253253
var schema = {
@@ -280,6 +280,55 @@ client.deleteSynonymMap('mysynonmap', function (err) {
280280
});
281281
```
282282
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+
283332
### Accessing the Raw Response
284333
285334
The raw response body is always returned as the 3rd argument in the callback.

0 commit comments

Comments
 (0)