I want to use multiple datasets feature of bloodhound to get results one from local database and other from google places api. I'm able to fetch results from my local database as following,
// instantiate the bloodhound suggestion engine
var searchData = new Bloodhound({
datumTokenizer: function (d) {
return Bloodhound.tokenizers.whitespace(d.value);
},
queryTokenizer: Bloodhound.tokenizers.whitespace,
remote: {
url: 'http:://localhost/address/fetch?q=%Query' //Local URL
}
});
// initialize the bloodhound suggestion engine
searchData.initialize();
// instantiate the typeahead UI
$('.typeahead').typeahead({
hint:false,
highlight: true,
minLength: 3
}, {
name:'search-data',
displayKey: 'title',
source: searchData.ttAdapter(),
templates: {
suggestion: Handlebars.compile('<p><strong>{{title}}</strong></p>')
}
});
I want to combine local database results with google places api results using bloodhound multiple datasets feature.
How to get google places api results using bootstrap bloodhound ?