GeoNames Home | Postal Codes | Download / Webservice | About 

GeoNames Forum
  [Search] Search   [Recent Topics] Recent Topics   [Groups] Back to home page 
[Register] Register / 
[Login] Login 
multiple results on exact name  XML
Forum Index -> General
Author Message
Shahzad



Joined: 04/03/2008 18:32:29
Messages: 9
Offline

i have been using ur database rather than web service

i have written this query

select name,asciiname,country,fclass,fcode,longitude,latitude,moddate from geoname where match(asciiname) AGAINST('washington') and country='us' and fclass = 'p'

its returning 187 records. I need to get only 1 record if exact name is specified.

Shoud i use limit and set it to 1?
marc



Joined: 08/12/2005 07:39:47
Messages: 4499
Offline

It depends on which 'Washington' you are looking for.

Marc

[WWW]
Shahzad



Joined: 04/03/2008 18:32:29
Messages: 9
Offline

lets say im looking for washington, the main city
or lets say im looking for karachi, the city.

there are even multiple results for that .
marc



Joined: 08/12/2005 07:39:47
Messages: 4499
Offline

you can sort the results by population and feature code and return the most relevant toponym. Though this does not mean that you are always returning the place your user was looking for. I guess it would be better to think about how to interact with your user.

Marc

[WWW]
 
Forum Index -> General
Go to:   
Powered by JForum 2.1.5 © JForum Team