Merge lp:~mterry/ubuntu-geonames/why-do-you-hate-andorra into lp:ubuntu-geonames

Proposed by Michael Terry
Status: Merged
Merged at revision: 14
Proposed branch: lp:~mterry/ubuntu-geonames/why-do-you-hate-andorra
Merge into: lp:ubuntu-geonames
Diff against target: 51 lines (+5/-3)
4 files modified
geoname-modpython.py (+1/-0)
geoname.py (+1/-0)
import-geonames.sh (+1/-1)
sphinx.conf (+2/-2)
To merge this branch: bzr merge lp:~mterry/ubuntu-geonames/why-do-you-hate-andorra
Reviewer Review Type Date Requested Status
Evan (community) Approve
Review via email: mp+56562@code.launchpad.net

Description of the change

I was getting an odd result when searching for a location in andorra -- now I know why!

To post a comment you must log in.
Revision history for this message
Evan (ev) wrote :

Nice find! Merged.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'geoname-modpython.py'
2--- geoname-modpython.py 2010-09-09 14:05:12 +0000
3+++ geoname-modpython.py 2011-04-06 13:26:55 +0000
4@@ -18,6 +18,7 @@
5 if fs.has_key('query'):
6 client = sphinxapi.SphinxClient()
7 client.SetServer('localhost', 3312)
8+ client.SetSortMode(sphinxapi.SPH_SORT_ATTR_DESC, 'population')
9 result = client.Query(fs['query'])
10 if result:
11 result = result['matches']
12
13=== modified file 'geoname.py'
14--- geoname.py 2010-09-09 14:05:12 +0000
15+++ geoname.py 2011-04-06 13:26:55 +0000
16@@ -20,6 +20,7 @@
17 def index(self, query=""):
18 client = sphinxapi.SphinxClient()
19 client.SetServer('localhost', 3312)
20+ client.SetSortMode(sphinxapi.SPH_SORT_ATTR_DESC, 'population')
21 result = client.Query(query)
22 if result:
23 result = result['matches']
24
25=== modified file 'import-geonames.sh'
26--- import-geonames.sh 2011-04-05 11:29:34 +0000
27+++ import-geonames.sh 2011-04-06 13:26:55 +0000
28@@ -21,7 +21,7 @@
29
30 # alter files for import
31 tail -n +2 iso-languagecodes.txt > iso-languagecodes.txt.tmp
32-grep -v '^#' countryInfo.txt | tail -n +2 > countryInfo.txt.tmp
33+grep -v '^#' countryInfo.txt > countryInfo.txt.tmp
34 tail -n +2 timeZones.txt > timeZones.txt.tmp
35
36 sudo -u postgres psql geonames <<EOT
37
38=== modified file 'sphinx.conf'
39--- sphinx.conf 2010-09-03 07:35:55 +0000
40+++ sphinx.conf 2011-04-06 13:26:55 +0000
41@@ -5,8 +5,8 @@
42 sql_user = geouser
43 sql_pass = geopw
44 sql_db = geonames
45-# TODO order by population, filter out lakes and other non-cities.
46-sql_query = SELECT geoname.geonameid, geoname.name, geoname.alternatenames FROM geoname
47+sql_query = SELECT geoname.geonameid, geoname.name, geoname.alternatenames, geoname.population AS population FROM geoname WHERE geoname.fclass='P'
48+sql_attr_uint = population
49 }
50
51 index geonames

Subscribers

People subscribed via source and target branches

to all changes: