Merge lp://qastaging/~mterry/geonames/search-countries-too into lp://qastaging/geonames

Proposed by Michael Terry
Status: Needs review
Proposed branch: lp://qastaging/~mterry/geonames/search-countries-too
Merge into: lp://qastaging/geonames
Diff against target: 73 lines (+34/-9)
2 files modified
src/geonames-query.c (+24/-9)
tests/test-geonames.c (+10/-0)
To merge this branch: bzr merge lp://qastaging/~mterry/geonames/search-countries-too
Reviewer Review Type Date Requested Status
Geonames developers Pending
Review via email: mp+303864@code.qastaging.launchpad.net

Commit message

Allow searching for a string that includes the country name, like "London, United Kingdom".

Description of the change

This is a quick and dirty fix, just to match previous behavior of Ubuntu System Settings before they switched to geonames (see linked bug).

Our search was never robust (only matched exact city prefixes). Ideally we'd do something really clever when searching.

But I didn't want to take on a whole search engine project, so I instead just tacked the country name onto the city name with a comma and matched against that.

Searches like "englishname, translatedname" or "translatedname, englishname" won't match correctly. For the same reason above, I didn't want to complicate our searching too much with combinatorial explosions of possibilities next time we tweak the algorithm.

To post a comment you must log in.

Unmerged revisions

27. By Michael Terry

Allow searching against country too

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
The diff is not available at this time. You can reload the page or download it.

Subscribers

People subscribed via source and target branches