darrenjennings / vue-autosuggest

🔍 Vue autosuggest component.
https://darrenjennings.github.io/vue-autosuggest
MIT License
621 stars 91 forks source link

Smart result ordering #204

Closed jestrux closed 3 years ago

jestrux commented 3 years ago

Screenshot_20200915-194654_Samsung Internet.jpg

Is there a way to make the results appear in order of match index? So like in the screenshot above Samwise Gamgee should appear before the other results because Sam matches at the start.

darrenjennings commented 3 years ago

@jestrux vue-autosuggest is just the presentation layer, so for example, that screenshot is just using a simple .filter + indexOf https://github.com/darrenjennings/vue-autosuggest/blob/master/docs/App.vue#L139. If you want "smarter" matches, then you have to defer this work to a search engine (on the server or maybe a naive one in the browser)

jestrux commented 3 years ago

Oh okay, makes sense. Really love what you've done with this by the way, I especially love the custom jsx render method.