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

Adds Continents to AutoComplete #4693

Merged
merged 5 commits into from
Oct 31, 2024
Merged

Conversation

gmechali
Copy link
Contributor

This PR implements a hack to add autocomplete for continents. We always fake that Continents came back in the response from the Google Maps Predictions API response, and hardcode the Place ID to DCID.

The Place IDs were fetched from here: https://developers.google.com/maps/documentation/places/web-service/place-id

For one word continent, we just add a matching for the single word query.
For two word continents (S|N America), we add matching for the single word query, and two word query if applicable.

We then compute the match score, and remove all continents with positive scores (negative score means a better match).

Note that we prepend the continents in order to give the continents an edge over other places that have the same score.
I also added a boost to scoring if the query matches the response from the start in order to give "America" an edge over "North America" when typing "Ameri".

@gmechali gmechali requested a review from dwnoble October 30, 2024 19:07
@gmechali gmechali marked this pull request as ready for review October 30, 2024 19:07
@gmechali gmechali merged commit 1ebe115 into datacommonsorg:master Oct 31, 2024
9 checks passed
@gmechali gmechali deleted the continents branch October 31, 2024 17: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.

2 participants