krisk / Fuse

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

suggestions api? #509

Closed fusionbeam closed 3 years ago

fusionbeam commented 3 years ago

Description

Does Fuse.js provide an api for auto complete suggestions? We're evaluating fuse.js for our catalog search and its speed is impressive. Our search input needs autocomplete functionality, as users type keys we want to provide suggestions with words that stem from the word being typed along with estimated number of matching results.

Describe the solution you'd like

Please provide some hints as to how to do this, I'dd be happy to contribute the code if it make sense for others.

Describe alternatives you've considered

Lunr.js

krisk commented 3 years ago

This can be simply achieved by executing a search of the fuse instance after every debounced callback during typing (i.e, onchange), and then presenting the search results in the type-ahead list.

Also, this behavior should not be part of the core Fuse.js library 😄

github-actions[bot] commented 3 years ago

This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 5 days