mirror of
https://gitee.com/dcren/initializr.git
synced 2025-11-08 02:14:55 +08:00
Support dashes in dependencies search box
This commit replaces the query tokenizer with a "nonword" tokenizer, in order to mirror the one used for the indexation process. This allows users to enter dashes in their search queries such as "data-" and still get meaningful results. Fixes #209
This commit is contained in:
@@ -181,7 +181,7 @@ $(function () {
|
|||||||
});
|
});
|
||||||
var starters = new Bloodhound({
|
var starters = new Bloodhound({
|
||||||
datumTokenizer: Bloodhound.tokenizers.obj.nonword('name', 'description', 'keywords', 'group'),
|
datumTokenizer: Bloodhound.tokenizers.obj.nonword('name', 'description', 'keywords', 'group'),
|
||||||
queryTokenizer: Bloodhound.tokenizers.whitespace,
|
queryTokenizer: Bloodhound.tokenizers.nonword,
|
||||||
identify: function (obj) {
|
identify: function (obj) {
|
||||||
return obj.id;
|
return obj.id;
|
||||||
},
|
},
|
||||||
|
|||||||
Reference in New Issue
Block a user