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

refactor: renovate FuzzySearch #4621

Merged
merged 7 commits into from
Mar 4, 2025
Merged

Conversation

marcelgerber
Copy link
Member

@marcelgerber marcelgerber commented Mar 3, 2025

Our FuzzySearch implementation, which we're mostly using inside the entity selector, has fallen a bit by the wayside, and could need some love (especially since I'm tackling #4622).

So, this PR

  • makes it more type-safe and versatile
  • updates fuzzysort. changelog here, tl;dr: the order of results has slightly changed for the better, and it now supports stripping diacritics and accents, which is helpful for España, for example.
  • moves it into utils
  • adds tests (thanks Copilot!)
  • prepares it for a key pointing to multiple data entries (e.g. GDP -> gdp-world-bank and GDP -> gdp-maddison), useful for feat(entitySelector): allow searching for entities in multiple languages #4622.

Copy link
Member Author

marcelgerber commented Mar 3, 2025

Copy link

socket-security bot commented Mar 3, 2025

Report too large to display inline

View full report↗︎

@owidbot
Copy link
Contributor

owidbot commented Mar 3, 2025

Quick links (staging server):

Site Dev Site Preview Admin Wizard Docs

Login: ssh owid@staging-site-fuzzy-search-improvements

SVG tester:

Number of differences (default views): 0 ✅
Number of differences (all views): 0 ✅

Edited: 2025-03-03 13:11:14 UTC
Execution time: 1.23 seconds

@marcelgerber marcelgerber force-pushed the fuzzy-search-improvements branch from 60895b1 to 1cbab99 Compare March 3, 2025 19:14
@marcelgerber marcelgerber changed the title enhance: better type safety for FuzzySearch refactor: renovate FuzzySearch Mar 3, 2025
@marcelgerber marcelgerber force-pushed the fuzzy-search-improvements branch 2 times, most recently from 6c20440 to d7824e9 Compare March 3, 2025 20:07
@marcelgerber marcelgerber marked this pull request as ready for review March 3, 2025 20:08
Copy link
Member

@sophiamersmann sophiamersmann left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sweet 👌🏻

Base automatically changed from entity-selector-sort-column to master March 4, 2025 10:22
@marcelgerber marcelgerber force-pushed the fuzzy-search-improvements branch from d7824e9 to 39724ff Compare March 4, 2025 10:25
@marcelgerber marcelgerber merged commit 075857a into master Mar 4, 2025
22 of 24 checks passed
@marcelgerber marcelgerber deleted the fuzzy-search-improvements branch March 4, 2025 10:33
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.

3 participants