Update docs to use async/await (#667)
* [docs] update readme and examples to use async/await * [apis] regenerate (including updated examples)
This commit is contained in:
@ -1,17 +1,18 @@
|
||||
.Return query terms suggestions (“auto-correction”)
|
||||
[source,js]
|
||||
---------
|
||||
client.suggest({
|
||||
index: 'myindex',
|
||||
body: {
|
||||
mysuggester: {
|
||||
text: 'tset',
|
||||
term: {
|
||||
field: 'title'
|
||||
const response = await client.suggest({
|
||||
index: 'myindex',
|
||||
body: {
|
||||
mysuggester: {
|
||||
text: 'tset',
|
||||
term: {
|
||||
field: 'title'
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}, function (error, response) {
|
||||
});
|
||||
|
||||
// response will be formatted like so:
|
||||
//
|
||||
// {
|
||||
@ -30,5 +31,5 @@ body: {
|
||||
// }
|
||||
// ]
|
||||
// }
|
||||
});
|
||||
---------
|
||||
|
||||
---------
|
||||
|
||||
Reference in New Issue
Block a user