hugo-toha / toha

A Hugo theme for personal portfolio
https://hugo-toha.github.io
MIT License
1.04k stars 599 forks source link

post search not returning matched results #973

Closed olpalu closed 1 month ago

olpalu commented 1 month ago

search is very odd, you have to write the whole post title to be displayed in the search result. is there a way to have more practical search, that return results that starts with some word or contain that word (or part of the word)...

hossainemruz commented 1 month ago

You don't have to put the whole title.You can search by only one or few words even by part of a word.

olpalu commented 1 month ago

@hossainemruz no it doesn't work, lets reproduce it, go to this link: https://toha-guides.netlify.app/posts/ search for the word: featured and you will receive : No matches found search link https://toha-guides.netlify.app/search/?keyword=featured

BernatBC commented 1 month ago

Hi @olpalu, you are right. After searching a little bit without finding what was the issue, I encountered that's a fuse.js issue (https://github.com/krisk/Fuse/issues/756). The fix is already merged, but it's not released. Meanwhile, I found that by setting threshold: 0.1 in assets/scripts/pages/search.js, fixes the problem temporarily.