GeoDB Cities

फ्रीमियम
Verified
द्वारा Michael Mogley | अपडेट किया गया hace 16 días | Data
लोकप्रियता

9.9 / 10

लेटेंसी

61ms

सेवा का स्तर

100%

Health Check

100%

सभी चर्चाओं पर वापस जाएं

Cities search namePrefix

Rapid account: Estecargo
estecargo
hace 3 años

Hi,

When we search the cities with the “namePrefix” parameter search if the city starts with this string, Is there a way to search anywhere in the city name?

We have some problems, because for example, if we search “Donostia” for the city “San Sebastian - Donostia” we receive 0 results.

Thanks in advance

Rapid account: Brunolopesbrandao
brunolopesbrandao Commented hace 2 años

Hi everyone,

When I try to search a city with namePrefix the endpoint search across region field and not in name or city field.

Please try namePrefix=São P and language=pt

Thanks

Rapid account: Wirefreethought
wirefreethought Commented hace 3 años

My pleasure! Thanks for helping improve the api

Rapid account: Estecargo
estecargo Commented hace 3 años

Works fine! Great work, thanks a lot

Rapid account: Wirefreethought
wirefreethought Commented hace 3 años

Try again

Rapid account: Wirefreethought
wirefreethought Commented hace 3 años

Ah yes, because it only considers word boundaries to be spaces. I could update it to include dashes. That should fix this.

To get regional cities, you need to use a slightly different endpoint:

GET /v1/geo/countries/{countryID}/regions/{regionId}/cities

See the full REST API docs for details on the endpoints and available params.

https://wirefreethought.github.io/geodb-cities-api-docs/

Rapid account: Estecargo
estecargo Commented hace 3 años

Sorry, we are trying some examples for the city Donostia-San Sebastián and we have this issue:

If we type “Sebas” it return in the list Donostia-San Sebastián.
If we type “San Sebas” it doenst return it.

Other question, can we filter the cities by region id?

Thanks in advance.

Rapid account: Estecargo
estecargo Commented hace 3 años

Hi!

Wow, now works fine!

Thank you for the quickness 😉

Rapid account: Wirefreethought
wirefreethought Commented hace 3 años

I just updated the logic to have the namePrefix value start matching at the beginning of every word in the name. Try it out.

Rapid account: Wirefreethought
wirefreethought Commented hace 3 años

Hi. Yes this is something I’ve been thinking about recently in fact. One solution could be to modify the namePrefix logic to start matching on the prefix at different words in the overall name, but this might be confusing in terms of the param name. Another would be to introduce a nameSearch param. I’ll think about this and get back to you.

चर्चा में शामिल हों - नीचे टिप्पणी जोड़ें:

नई टिप्पणियाँ पोस्ट करने के लिए लॉग इन / साइनअप करें