added docs to the repo
This commit is contained in:
34
docs/_examples/suggest.asciidoc
Normal file
34
docs/_examples/suggest.asciidoc
Normal file
@ -0,0 +1,34 @@
|
||||
.Return query terms suggestions (“auto-correction”)
|
||||
[source,js]
|
||||
---------
|
||||
client.suggest({
|
||||
index: 'myindex',
|
||||
body: {
|
||||
mysuggester: {
|
||||
text: 'tset',
|
||||
term: {
|
||||
field: 'title'
|
||||
}
|
||||
}
|
||||
}
|
||||
}, function (error, response) {
|
||||
// response will be formatted like so:
|
||||
//
|
||||
// {
|
||||
// ...
|
||||
// mysuggester: [
|
||||
// {
|
||||
// text: "tset",
|
||||
// ...
|
||||
// options: [
|
||||
// {
|
||||
// text: "test",
|
||||
// score: 0.75,
|
||||
// freq: 5
|
||||
// }
|
||||
// ]
|
||||
// }
|
||||
// ]
|
||||
// }
|
||||
});
|
||||
---------
|
||||
Reference in New Issue
Block a user