Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Exact matches are ranked too low #6

Open
leeoniya opened this issue Feb 20, 2024 · 1 comment
Open

Exact matches are ranked too low #6

leeoniya opened this issue Feb 20, 2024 · 1 comment
Labels
enhancement New feature or request

Comments

@leeoniya
Copy link

hey @m31coding!

great to see someone else working on a better fuzzy search :) i found this project on HN.

i've added it to the uFuzzy demo/bench in leeoniya/uFuzzy@5ebe1ba.

indexing the 4MB haystack takes ~1400ms. after that, giving it a quick try with the term "twilight", the results are missing or mis-ranking many exact matches? or perhaps i'm just holding it wrong 😅 ?

cheers! 🍻

https://leeoniya.github.io/uFuzzy/demos/compare.html?libs=uFuzzy,fuzzy-search&search=twilight

image
@m31coding
Copy link
Owner

m31coding commented Feb 20, 2024

Hi @leeoniya, thank you very much for your input and for adding this project to the demo / benchmark. Your work is really nice! I have added a comment to your commit with minor suggestions.

It looks like we have chosen very different implementations. The top 10 results are very similar, except that the term twilit shows up on rank 8 on the right hand side. The other matches shown on the left hand side are indeed ranked very low in my implementation. E.g. the query twilight matches Twilight Phenomena: The Lodgers of House 13 Collector's Edition only with a quality of 0.13.

The reason for this is that the quality increases linearly with the number of common n-grams and the word twilight is only a small part of the full term. The best use case for my library are terms that have 1-3 words, e.g. names of places or persons. For terms with more words your library is clearly doing better for exact matches!

I will think about how to improve the library in this respect. Thank you again for your input!

@m31coding m31coding added the enhancement New feature or request label Feb 20, 2024
@m31coding m31coding changed the title exact matches are missing or ranked too low? Exact matches are ranked too low Feb 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants