I am trying to make a simple autocomplete with typeahead.js.
The source where words are indexed is my amazon elasticsearch service cluster endpoint. I set all permissions.
Now i have this code :
$('#remote .typeahead').typeahead({
highlight: true,
},
{
name: 'elasticremote',
source: function(query, syncResults, asyncResults) {
$.get('https://xxxxxxxxxxxxxxxxx.eu-west-1.es.amazonaws.com/xxxxxxx/_search?q=' + query, function(data) {
asyncResults(data)
});
}
})
Problem is : when i am starting typing in the search field, nothing happens, no suggestions or anything. Moreover i get an error in my console log
TypeError: c.slice is not a function
in typeahead.bundle.min.js
What's wrong with my code ?
Thanks for helping.