tibudiyanto / jakarta-vax-availability

jakarta-vax-availability.vercel.app
100 stars 46 forks source link

Add fuzzy search #44

Closed hendrasan closed 3 years ago

hendrasan commented 3 years ago

@pveyes @tibudiyanto

Continuing from #14 (sorry, accidentally closed it due to my deleting the already pushed main branch since there were some errors and stuff when I tried to merge from latest, nevermind)

Anyway, I'm not sure about what Fuse options to use for the best experience. Searching "baru" now returns the Kalibaru, Marunda, and Semper Barat results (because of the fuzziness). It might be good because user's typos will still generate results, but it can also be a bit confusing for that "baru" case.

I only include the nama_lokasi_vaksinasi, wilayah, kecamatan, and kelurahan. I noticed there is alamat_lokasi_vaksinasi in the API, but since it was not shown in the frontend, I did not include it for the search.

vercel[bot] commented 3 years ago

Someone is attempting to deploy a commit to a Personal Account owned by @tibudiyanto on Vercel.

@tibudiyanto first needs to authorize it.

vercel[bot] commented 3 years ago

This pull request is being automatically deployed with Vercel (learn more).
To see the status of your deployment, click below or on the icon next to each commit.

🔍 Inspect: https://vercel.com/tibudiyanto/jakarta-vax-availability/8LTszBMd1Lwe1M79iKMG7zrgLme2
✅ Preview: https://jakarta-vax-availability-git-fork-hendrasan-c46304-tibudiyanto.vercel.app

tibudiyanto commented 3 years ago

sorry you have conflicts :(

pveyes commented 3 years ago

also, can you rebase after #56 and add the same fuzzy search logic to map page?

Maybe create both custom component <SearchBox /> and custom hook useFuzzySearch

Just to illustrate

const filtered = useFuzzySearch(schedule, searchQuery)

<SearchBox query={searchQuery} onChange={query => setSearchQuery(query)} />
hendrasan commented 3 years ago

Okay, updated. Should hopefully work and not break stuff.

sonnylazuardi commented 3 years ago

image

please rebase, i think there should be current location button on map

pveyes commented 3 years ago

weird iOS 15 flex, but okay 🤪

hendrasan commented 3 years ago

Updated