npm i fuse.js --save
var options = {
shouldSort: true,
threshold: 0.6,
location: 0,
distance: 100,
maxPatternLength: 32,
minMatchCharLength: 1,
keys: [
"text"
]
};
var fuse = new Fuse(list, options); // "list" is the item array
var result = fuse.search("silence");
//console.log(list);
console.log(result)
// list will contains list of elements for search
var options = {
shouldSort: true,
threshold: 0.6,
location: 0,
distance: 100,
maxPatternLength: 32,
minMatchCharLength: 1,
keys: [
"text"
]
};
var fuse = new Fuse(list, options); // "list" is the item array
var result = fuse.search("silence");
//console.log(list);
console.log(result)
// list will contains list of elements for search
Comments
Post a Comment