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

feat(search): match geographic entities in search #3388

Merged

Conversation

marcelgerber
Copy link
Member

@marcelgerber marcelgerber commented Mar 21, 2024

Part of #3330.


TODOs:

  • Make this feature more discoverable:
    • Add something like Life expectancy India Nigeria to the placeholder text
    • Add a hint text somewhere? (needs design)
    • Provide suggestions in an autocomplete menu?
  • Sort entities alphabetically, probably?
  • Figure out a better way to produce availableEntityNames for Algolia:
  • Use different icon for non-region entities, e.g. salmon (farmed)
  • Try to prevent matches like Korea (former) for South Korea [regime polity south korea]
  • Figure out the Algolia situation with synonyms (UK -> United Kingdom, UAE -> United Arab Emirates)
  • Remove feature disparity between full search page and Autocomplete search
  • What to do about explorer views? Tricky... feat(search): pre-select explorer entities if they appear in search query #3483
  • Check why there's no matches for "high-income countries" - maybe because of the hyphen?
    • Potentially add a synonym for that
  • Move /thumbnail URL to .env file
  • Entity indexing: Why does access-to-clean-fuels-and-technologies-for-cooking supposedly have data for "Low-income countries", even though it hasn't?

@marcelgerber marcelgerber force-pushed the algolia-geographic-entities branch 2 times, most recently from a3c1ac9 to d0cd95b Compare March 26, 2024 08:00
@marcelgerber marcelgerber force-pushed the algolia-geographic-entities branch 2 times, most recently from 7e31f37 to d0d5c6a Compare March 27, 2024 14:02
@marcelgerber marcelgerber force-pushed the algolia-geographic-entities branch from d0d5c6a to aae51b7 Compare March 27, 2024 23:29
@marcelgerber marcelgerber changed the base branch from master to available-entities-accurate March 27, 2024 23:29
Copy link
Member Author

marcelgerber commented Mar 27, 2024

This stack of pull requests is managed by Graphite. Learn more about stacking.

Join @marcelgerber and the rest of your teammates on Graphite Graphite

@marcelgerber marcelgerber force-pushed the available-entities-accurate branch from 9fa5f53 to 75f90b7 Compare March 28, 2024 13:42
@marcelgerber marcelgerber changed the base branch from available-entities-accurate to available-entities-indexing March 28, 2024 14:17
@marcelgerber marcelgerber force-pushed the algolia-geographic-entities branch from aae51b7 to ce7b3e8 Compare March 28, 2024 14:17
@marcelgerber marcelgerber changed the base branch from available-entities-indexing to remove-available-entities-config March 28, 2024 14:18
@marcelgerber marcelgerber force-pushed the algolia-geographic-entities branch from ce7b3e8 to 1e9bfd8 Compare March 28, 2024 14:18
@marcelgerber marcelgerber force-pushed the remove-available-entities-config branch from cf502dd to 240aa18 Compare March 29, 2024 08:13
@marcelgerber marcelgerber force-pushed the algolia-geographic-entities branch from 1e9bfd8 to d5845ab Compare March 29, 2024 08:13
@marcelgerber marcelgerber force-pushed the remove-available-entities-config branch from 240aa18 to c49358e Compare March 29, 2024 09:52
@marcelgerber marcelgerber force-pushed the algolia-geographic-entities branch from d5845ab to 0ef4ae7 Compare March 29, 2024 09:52
Base automatically changed from remove-available-entities-config to master April 8, 2024 11:58
@marcelgerber marcelgerber force-pushed the algolia-geographic-entities branch from 0ef4ae7 to 5aa3cd9 Compare April 10, 2024 14:55
// Remove any parenthetical content from _the end_ of a string
// E.g. "Africa (UN)" -> "Africa"
export function removeTrailingParenthetical(str: string): string {
return str.replace(/\s*\(.*\)$/, "")

Check failure

Code scanning / CodeQL

Polynomial regular expression used on uncontrolled data

This [regular expression](1) that depends on [library input](2) may run slow on strings with many repetitions of ' '. This [regular expression](3) that depends on [library input](2) may run slow on strings starting with '(' and with many repetitions of '('.
@marcelgerber marcelgerber force-pushed the algolia-geographic-entities branch from 9f0d235 to 1e783f8 Compare April 11, 2024 15:33
@marcelgerber marcelgerber changed the base branch from master to search-utils April 11, 2024 15:33
@marcelgerber marcelgerber force-pushed the algolia-geographic-entities branch from cb9cd51 to 1f70486 Compare April 16, 2024 07:08
@marcelgerber marcelgerber merged commit 7f88da5 into search-feature-branch-2024-2 Apr 16, 2024
14 of 17 checks passed
@marcelgerber marcelgerber deleted the algolia-geographic-entities branch April 16, 2024 07:10
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.

1 participant