fastrepl / canary

🐤 Canary is modern Algolia DocSearch replacement
https://getcanary.dev
Other
354 stars 10 forks source link

Search doesn't match exact result? #128

Open jahanson opened 6 days ago

jahanson commented 6 days ago

When trying the search on the demo website I'm unable to find an exact result. It only shows fuzzy results.

I typed 'why' too fast the first time and realized what was going on soon after.

Is this intended?

https://github.com/user-attachments/assets/b7932648-c608-400b-b693-b4b3da0715a3

yujonglee commented 5 days ago

@jahanson

Thanks for opening the issue.

This is definitely not the ideal experience. The problem is that "why" is included in stopwords.

"why" in Canary.Native.stopwords()
# true

https://github.com/fastrepl/canary/blob/c1f03cbbee82831ab2ed966fbfd12032c54d5fdc/core/lib/canary/index/index.ex#L175

If you try other keyword like "vitepress", it will work as expected.

I think quick way to fix this is do not apply stopwords when query is just a single word (String.split(query, " ") < 2).

yujonglee commented 5 days ago

just tried search without stopwords, but same behavior. I think I should create a repro and open a issue in Typesense side. Please let me know if you have idea on how to fix it.