krisk / Fuse

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

Support custom search key list when searching #667

Closed springuper closed 7 months ago

springuper commented 2 years ago

In this PR, I added another option keys in search method to be able to specify a list of key when performing index search:

fuse.search('od man', { keys: ['title'] }) // returns 1 item

fuse.search('od man', { keys: ['tags'] }) // returns an empty list

It's quite useful in such scenarios:

springuper commented 2 years ago

@krisk hopefully you could help take a look at this PR in the near future.