The http://geoname-lookup.ubuntu.com code is here http://bazaar.launchpad.net/~ubuntu-geonames-hackers/ubuntu-geonames/trunk/view/head:/geoname-modpython.py
Note the: client.SetSortMode(sphinxapi.SPH_SORT_ATTR_DESC, 'population')
The http:// geoname- lookup. ubuntu. com code is here http:// bazaar. launchpad. net/~ubuntu- geonames- hackers/ ubuntu- geonames/ trunk/view/ head:/geoname- modpython. py
Note the: client. SetSortMode( sphinxapi. SPH_SORT_ ATTR_DESC, 'population')