Skip to content

Commit

Permalink
fix(search): recognize strings like "high-income countries"
Browse files Browse the repository at this point in the history
  • Loading branch information
marcelgerber committed Apr 16, 2024
1 parent dfad8f3 commit 1f70486
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions site/search/SearchUtils.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,10 @@ export function pickEntitiesForChartHit(hit: IChartHit): EntityName[] {

// Pick entity if the matched sequence contains the full entity name
if (
matchedSequenceLowerCase.includes(
entityNameWithoutTrailingParens.toLowerCase()
matchedSequenceLowerCase.startsWith(
entityNameWithoutTrailingParens
.replaceAll("-", " ") // makes "high-income countries" into "high income countries", enabling a match
.toLowerCase()
)
)
return true
Expand Down

0 comments on commit 1f70486

Please sign in to comment.