Hmmm. Why can’t you just do a single request without the country filters, then filter by country on the client side once you get the results? That should be more efficient I would think.
Thanks, I will try it and let you know.
My need is to do an autocomplete search view like google maps… I am trying to do a smart algorithm.
Currently I am doing 2 requests :
find cities in a radius -> exclude the one which are not in the user’s country + sort them by distance (because the radius is large)
find cities in all the world and sort them by population
Then I reorder them according to the user’s query.
I am assuming that the city the user is searching for should be in the first request. The second request is here in case of the user search for a city in a foreign country.
It is far to be as efficient as google maps but the results are quite correct.
My thinking at the time was that users looking to sort cities by distance from a location probably wouldn’t care which country those cities were in, Guess I was wrong 😃 I will add this in the coming days and let you know.
Hmmm. Why can’t you just do a single request without the country filters, then filter by country on the client side once you get the results? That should be more efficient I would think.
Thanks, I will try it and let you know.
My need is to do an autocomplete search view like google maps… I am trying to do a smart algorithm.
Currently I am doing 2 requests :
Then I reorder them according to the user’s query.
I am assuming that the city the user is searching for should be in the first request. The second request is here in case of the user search for a city in a foreign country.
It is far to be as efficient as google maps but the results are quite correct.
This has been deployed! New params, countryIds and excludedCountryIds, now available for this endpoint. Try it out.
My thinking at the time was that users looking to sort cities by distance from a location probably wouldn’t care which country those cities were in, Guess I was wrong 😃 I will add this in the coming days and let you know.