vue-bootstrap-typeahead icon indicating copy to clipboard operation
vue-bootstrap-typeahead copied to clipboard

Fuzzy search

Open Owumaro opened this issue 6 years ago • 2 comments

This one is tricky...

https://github.com/alexurquhart/vue-bootstrap-typeahead/blob/85ff0bd1fc947f86959813115d0ed4cf34d3b832/src/components/VueBootstrapTypeaheadList.vue#L83

Currently the results from the backend are filtered using a regexp based on the query. It would be nice to be able to make it fuzzy. Here are a few examples from Google Autocomplete :

image

The - is matched with the space char

image

The c is matched with a k

Not sure if this should be included in the default component, or be allowed as an extra (this will probably require a dependency to a js fuzzy search library).

This issue has low priority :smile:

Owumaro avatar Aug 31 '18 12:08 Owumaro

This is a good idea as well, I think before the components gets a 1.0 release it should allow for both custom highlight and custom matching functions.

alexurquhart avatar Aug 31 '18 14:08 alexurquhart

I think this is redundant. Because there will always be requirements to provide more and more fuzzy matching rules. Programmers will never be able to satisfy all fuzzy matching needs.

And by the way, you are always free to create a watcher and provide an array of suggestions yourself and it will work. All you need to do is to use your favorite fuzzy search library and adopt it using watcher as specified in the example in the landing page (just scroll down there is an example with a Watcher).

boamigo avatar Oct 20 '18 19:10 boamigo