Does elasticsearch.js package support browser use now?
The official node.js package is supported in the browser, see https://www.npmjs.com/package/elasticsearch. Is there any specific question?
function newAutocomplete(){
var client = new $.es.Client({
hosts: 'localhost:9200'
});
client.search({
index: 'user',
body: {
suggest: {
suggestion: {
prefix: 'Rit',
completion: {
field: 'suggest'
}
}
}
}
}).then(function (resp) {
var hits = resp.hits.hits;
}, function (err) {
console.trace(err.message);
});
}
From above code I want to store output(suggestion) in an array, How can I do that?
This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.