krisk / Fuse

Lightweight fuzzy-search, in JavaScript
https://fusejs.io/
Apache License 2.0
18.36k stars 772 forks source link

Add option "itemsOptions" #321

Closed lucasmrdt closed 4 years ago

lucasmrdt commented 5 years ago

This option allows the user to specify custom options for each item.

// example

const itemsOptions = [{ threshold: 0.2 }, { threshold: 1 }];
const fuse = new Fuse(['batman', 'apple'], { itemsOptions });
fuse.search('bat');
// [0, 1]