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

[Feature] Improve Country Search with Weighted Ranking in _filterCountries() #1937

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

kunalbedi-pfg
Copy link

@kunalbedi-pfg kunalbedi-pfg commented Jan 28, 2025

closes #1922

This PR enhances the country search functionality in _filterCountries() by implementing a weighted ranking strategy for search results. The new logic ensures that countries are displayed in the following order based on assigned weightage:

  1. Countries where the ISO2 code matches the search query exactly.
  2. Countries whose names start with the search query.
  3. Countries whose names contain the search query anywhere.
  4. Countries where the full dial code matches the query.
  5. Countries where the country initials match the query.

This update significantly improves search result relevance and user experience.

@kunalbedi-pfg kunalbedi-pfg changed the title enhanced country search functionality Improve Country Search with Weighted Ranking in _filterCountries() Jan 28, 2025
@kunalbedi-pfg kunalbedi-pfg changed the title Improve Country Search with Weighted Ranking in _filterCountries() [Feature] Improve Country Search with Weighted Ranking in _filterCountries() Jan 28, 2025
@kunalbedi-pfg kunalbedi-pfg marked this pull request as ready for review January 28, 2025 11:57
@kunalbedi-pfg
Copy link
Author

@jackocnr - I hope you’re doing well. When you have a moment, could you kindly review this PR? It is currently blocking our progress, and we would greatly appreciate your feedback. Please let us know if any changes are required, or if everything looks good, we would appreciate your approval.

@kunalbedi-pfg
Copy link
Author

@jackocnr - I hope you’re doing well. Could you kindly review this PR as soon as possible as it is currently blocking our progress, and we would greatly appreciate your feedback. Please let us know if any changes are required, or if everything looks good, we would appreciate your approval. Thank you!

@jackocnr
Copy link
Owner

Hi there, thanks for putting this together - I look forward to reviewing this and hopefully getting it merged and released ASAP. Unfortunately, I have very limited time to commit to open-source over the next month or so, due to life commitments. So most likely I will only get to this in late March. Apologies for the delay. You shouldn't let this block you though - you should just switch to using your version for now, and then later when we get this merged into master, you can switch back again.

@kunalbedi-pfg
Copy link
Author

Sure, thank you for your comment. We will wait for late march for this to get merged.

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

Successfully merging this pull request may close these issues.

[FEATURE REQUEST] Support for searching countries by filtering as you type, and/or by abbreviations
2 participants