react-native-search-filter
react-native-search-filter copied to clipboard
Allow keys weight.
Fuse does supports specifying the keys as an array of objects like the following, would be super nice to have. It permits to sort the results depending on the weight the field that matched has. 😋
const KEYS_TO_FILTER = [
{ name: 'item.title', weight: 1.0 },
{ name: 'item.description', weight: 0.8 },
{ name: 'item.author', weight: 0.4 }
];
Will surely add this one on the next release. Thanks for the suggestion!
Just want to +1 this and also mention that it would be really nice to be able to set other Fuse options such as threshold
. The default of 0.6 is too permissive for our use case.
Yes, +1. Thanks for considering this!