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

"Weird" search live completion result order? #8

Closed
hartwork opened this issue Nov 9, 2021 · 8 comments
Closed

"Weird" search live completion result order? #8

hartwork opened this issue Nov 9, 2021 · 8 comments

Comments

@hartwork
Copy link
Contributor

hartwork commented Nov 9, 2021

When switching to Spanish+English and typing "gato" (for animal cat in Spanish), I see this:

gato

What's surprising here is that:

  • Sort seems case sensitive without intention (but that's a guess)
  • Longer words appear before shorter words, while sharing identical prefix.

Is that known and intended?

@karlb
Copy link
Owner

karlb commented Nov 10, 2021

This is not intended. The scoring used here is max_score * rel_importance but rel_importance is null, thereby throwing off the whole sorting algorithm. It works much better when is use max_score * coalesce(rel_importance, 0.01), but I want to check whether rel_importance is allowed to be null at all and remind myself of the exact meaning of these variables before pushing a fix.

I assume https://github.com/karlb/wikdict-web/issues/9 has the same underlying reason.

@hartwork
Copy link
Contributor Author

This is not intended.

Okay, nice.

[..] and remind myself of the exact meaning of these variables before pushing a fix.

Looking forward to that.

I assume #9 has the same underlying reason.

I have a feeling that there is a hardcoded limit saying "words of length 3 are too short" as well. True?
Though maybe that's off-topic here 🤷

karlb added a commit to karlb/wikdict-gen that referenced this issue Nov 14, 2021
The bad join condition led to null values in places where we should have
results. This impacts karlb/wikdict-web#8.
@karlb karlb closed this as completed in 3bd80b5 Nov 14, 2021
@karlb
Copy link
Owner

karlb commented Nov 14, 2021

I have a feeling that there is a hardcoded limit saying "words of length 3 are too short" as well. True?

Three letters should be sufficient, but words shorter than that won't get completed. After three letters, a completion list for words starting with these letters is fetched and used as the user continues typing. This reduces latency while typing and is more cacheable than doing a request after each letter.

@hartwork
Copy link
Contributor Author

With 3bd80b5 applied I get this:

gato2

Cool! 🎉 Any chance you could re-deploy production from master?

@karlb
Copy link
Owner

karlb commented Nov 16, 2021

Cool! tada Any chance you could re-deploy production from master?

Done, see also today's blog post.

@hartwork
Copy link
Contributor Author

@karlb https://www.wikdict.com/en-es/ is still putting "gato" after "Gato Risón", even after forced reload. Am I missing something?

@hartwork
Copy link
Contributor Author

Chromium seems fine, but it's still broken in Firefox. Turns out that the https://www.wikdict.com/typeahead/en-es/gat response is cached, will only expire ~30 minutes from now, and forced reload is being ignored on that resource. Oh my 😃 So I guess it will work fine from 16:00 UTC+1 then…

@hartwork
Copy link
Contributor Author

So I guess it will work fine from 16:00 UTC+1 then…

Works in Firefox now as expected 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants