corejavascript / corejavascript/typeahead.js
Highest hit on top, even with multiple sources?
- Dominant language
- JavaScript
- Stars
- 968
- Forks
- 231
- PR merge metrics
- No merged PRs in 30d
Description
I'm getting the following result when using multiple sources (and bloodhound).
Is there anyway I can get it to the top? So that the results are not sorted by group but by biggest hit?

This is my current code.
$(".global-search input").typeahead({
hint: true,
highlight: true,
minLength: 2,
maxItem: 30,
dynamic: true,
}, {
source: suppliersEngine.ttAdapter(),
name: 'suppliers',
templates: {
suggestion: function (data) {
return ''+ data.name + ' Suppliers';
}
}
}, {
source: recipesEngine.ttAdapter(),
name: 'recipes',
templates: {
suggestion: function (data) {
return ''+ data.name + ' Recipes';
}
}
}, {
source: preparationsEngine.ttAdapter(),
name: 'preparations',
templates: {
suggestion: function (data) {
return ''+ data.name + ' Preparations';
}
}
});
Any help would be greatly appreciated!
Contributor guide
Assessment
This issue has not been assessed yet.