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 2 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.

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
1 participant