haykkh / what-the-playlist

what playlist was that song in again??
https://whattheplaylist.com
6 stars 2 forks source link

feat: search system #44

Closed haykkh closed 1 year ago

haykkh commented 1 year ago

https://algolia.nuxtjs.org/

haykkh commented 1 year ago

https://github.com/xlanex6/nuxt-meilisearch

haykkh commented 1 year ago

https://github.com/krisk/Fuse/issues/275

haykkh commented 1 year ago

So i've gotten it to a goodish point. Lower thresholds seem to work better for my use case, but also decided to have a slider for the threshold

haykkh commented 1 year ago

Issue right now seems to be that the runSearch in the watcher doesn't use updated threshold if loading the page from raw. When it hot reloads it works fine

watch(() => fuse.value.options.threshold, () => {
  runSearch(search.value)
})
haykkh commented 1 year ago

useful: https://github.com/shayneo/vue-fuse/blob/master/apps/vue-fuse/use-fuse.ts

haykkh commented 1 year ago

In fuse.esm.js when _searchObjectList creates a searcher with this.options, this.options isn't the new options

  _searchObjectList(query) {
    const searcher = createSearcher(query, this.options);
haykkh commented 1 year ago

So, if i initialize musicStore.playlists with a value (ie /playlists doesn't have to useSpottyFetch all playlist tracks), it all works fine. So seems like smth in the process of fetching the tracks causes fuse to not accept changes to options