This repository creates a service to search cities using the jaro-winkler algorithm
Run npm i to install al dependencies
- JARO_WINKLER_THRESHOLD: this one defines the default threshold for string comparision, every string with a value greater will be in the response
- SERVER_PORT: If this variable is not set, port 4000 will be set as default
Search with no results
query {
Cities(
search: "SomeRandomCityInTheMiddleOfNowhere"
minimumScore: 0.75
) {
city {
name
lat
long
}
score
}
}
Search with results, and using default score threshold
query {
Cities(
search: "Lond"
#minimumScore: 0.75
) {
city {
name
lat
long
}
score
}
}
- Generate a proper database to allow dynamic data insertion
- Validate used algotithm performance and replace it if needed
- Custom error validation, by now we depend on graphQL validations