Author |
Message |
24/08/2006 14:55:58
|
Anonymous
|
Hello,
I am trying to use standard search with the JSON webservice but I cannot seem to pass wildcard arguments with the query. Example:
http://ws.geonames.org/searchJSON?q=vatic&maxRows=100&formatted=true
I've placed '%', '*', and '?' url-encoded characters but it still does not return results ('Vatican' in this example). Is there any way I am doing this wrong or are searches in boolean mode not supported yet?
Best regards,
Ligius
|
|
|
25/08/2006 10:03:08
|
Anonymous
|
Actually, in SQL mode it looks like this:
SELECT * FROM geonames1 WHERE MATCH(asciiname) AGAINST ('vatic*' IN BOOLEAN MODE)
|
|
|
25/08/2006 12:17:28
|
marc
Joined: 08/12/2005 07:39:47
Messages: 4412
Offline
|
Hi Ligius
Wildcards are not yet supported by the geonames search for performance and index size reasons.
There is, however, a not yet documented parameter name_startsWith for a prefix query.
http://ws.geonames.org/searchJSON?name_startsWith=vatic&formatted=true
We are not using MySQl. Do you get acceptable performance with your query?
Regards,
Marc
|
|
|
|
28/08/2006 13:24:07
|
Anonymous
|
Thank you for the information. Here are the results of some queries using a 2Ghz P4, 1Gig RAM, Windows XP, mySQL4-something, fulltext indexing on ansiname, SQLYog as client. Further queries of the same parameter are cached, though query cache is not activated.
[ 62 ms]*/ SELECT geonameid,ansiname,name,latitude,longitude,feature_class,feature_code,country_code,admin1_code FROM geonames WHERE MATCH(ansiname) AGAINST ('timiso*' IN BOOLEAN MODE) LIMIT 100
[ 359 ms]*/ SELECT geonameid,ansiname,name,latitude,longitude,feature_class,feature_code,country_code,admin1_code FROM geonames WHERE MATCH(ansiname) AGAINST ('new york*' IN BOOLEAN MODE) LIMIT 100
[ 31 ms]*/ SELECT geonameid,ansiname,name,latitude,longitude,feature_class,feature_code,country_code,admin1_code FROM geonames WHERE MATCH(ansiname) AGAINST ('comman*' IN BOOLEAN MODE) LIMIT 100
[ 63 ms]*/ SELECT geonameid,ansiname,name,latitude,longitude,feature_class,feature_code,country_code,admin1_code FROM geonames WHERE MATCH(ansiname) AGAINST ('trepid*' IN BOOLEAN MODE) LIMIT 100
[ 375 ms]*/ SELECT geonameid,ansiname,name,latitude,longitude,feature_class,feature_code,country_code,admin1_code FROM geonames WHERE MATCH(ansiname) AGAINST ('stap*' IN BOOLEAN MODE) LIMIT 100
[ 547 ms]*/ SELECT geonameid,ansiname,name,latitude,longitude,feature_class,feature_code,country_code,admin1_code FROM geonames WHERE MATCH(ansiname) AGAINST ('london*' IN BOOLEAN MODE) LIMIT 100
[ 688 ms]*/ SELECT geonameid,ansiname,name,latitude,longitude,feature_class,feature_code,country_code,admin1_code FROM geonames WHERE MATCH(ansiname) AGAINST ('paris*' IN BOOLEAN MODE) LIMIT 100
[ 359 ms]*/ SELECT geonameid,ansiname,name,latitude,longitude,feature_class,feature_code,country_code,admin1_code FROM geonames WHERE MATCH(ansiname) AGAINST ('new york*' IN BOOLEAN MODE) LIMIT 100
Now without boolean mode enabled:
[ 687 ms]*/ SELECT geonameid,ansiname,name,latitude,longitude,feature_class,feature_code,country_code,admin1_code FROM geonames WHERE MATCH(ansiname) AGAINST ('new york') LIMIT 100
[ 406 ms]*/ SELECT geonameid,ansiname,name,latitude,longitude,feature_class,feature_code,country_code,admin1_code FROM geonames WHERE MATCH(ansiname) AGAINST ('london') LIMIT 100
[ 344 ms]*/ SELECT geonameid,ansiname,name,latitude,longitude,feature_class,feature_code,country_code,admin1_code FROM geonames WHERE MATCH(ansiname) AGAINST ('paris') LIMIT 100
...
So on my machine (developer) queries using Boolean mode typically take about the same amount of time. Sorry for the long post but as you can see performance varies randomly and cannot be judged accurately. The database is not yet deployed on the production server, but performance is expected to improve at least 10 to 100-fold.
Best regards,
Ligius
|
|
|
31/10/2006 19:34:59
|
Anonymous
|
Is there a similar undocumented parameter for the postal code search? I would like to be able to retrieve all postal codes in a given country which begin with a particular prefix. Is this possible at this time?
Thanks,
Ben
|
|
|
02/11/2006 18:41:26
|
marc
Joined: 08/12/2005 07:39:47
Messages: 4412
Offline
|
Hi Ben
Here you go :
http://ws.geonames.org/postalCodeSearch?postalcode_startsWith=901&maxRows=10&country=ch
Regards
Marc
|
|
|
|
03/11/2006 14:57:48
|
Anonymous
|
Greatly appreciated!
Ben
|
|
|
23/11/2006 18:00:40
|
Anonymous
|
is it possible using /postalcodesearch to do a placename starts with?
|
|
|
25/11/2006 22:26:08
|
marc
Joined: 08/12/2005 07:39:47
Messages: 4412
Offline
|
Yes there is now a possibility:
http://ws.geonames.org/postalCodeSearch?placename_startsWith=menl
Regards
Marc
|
|
|
|
24/07/2007 16:19:24
|
LarryFlynt
Joined: 24/07/2007 16:16:22
Messages: 10
Offline
|
There's a bug like this:
http://ws.geonames.org/postalCodeSearch?placename_startsWith=Ry%C5%AB%C5%8D
or
http://ws.geonames.org/postalCodeSearch?placename_startsWith=K%C3%B6l
No utf8 Support?
|
|
|
24/07/2007 19:10:15
|
marc
Joined: 08/12/2005 07:39:47
Messages: 4412
Offline
|
Hi Larry
The first query seems to be for Japan and we don't have Japanese postal codes. This explains why we don't find anything.
The first query has a German Umlaut and it looks like a bug. I will to see why this happens. There are a couple of places where we do some tricks with German Umlauts to make sure we find both possible spellings 'oe' and 'รถ'. This could cause a problem for the 'startsWith' query.
Marc
|
|
|
|
30/07/2007 16:25:55
|
LarryFlynt
Joined: 24/07/2007 16:16:22
Messages: 10
Offline
|
had you found it?
|
|
|
31/07/2007 18:17:57
|
marc
Joined: 08/12/2005 07:39:47
Messages: 4412
Offline
|
Not yet. Sorry
Marc
|
|
|
|
03/08/2007 11:19:49
|
LarryFlynt
Joined: 24/07/2007 16:16:22
Messages: 10
Offline
|
big thx for fixing it.
but now i found a error at this:
http://ws.geonames.org/postalCodeSearch?style=SHORT&maxRows=10&placename_startsWith=ber
<geonames>
<status message="maxClauseCount is set to 1024" value="12"/>
</geonames>
the maxClauseCount can deactivate if maxRows is set or?
|
|
|
12/08/2007 10:48:16
|
marc
Joined: 08/12/2005 07:39:47
Messages: 4412
Offline
|
Hi Larry
I have fixed this as well. It had to do with the number of places starting with "Ber" and I had to rewrite the query.
Cheers
Marc
|
|
|
|
12/08/2007 21:20:10
|
LarryFlynt
Joined: 24/07/2007 16:16:22
Messages: 10
Offline
|
thank you
|
|
|
14/08/2007 10:58:00
|
LarryFlynt
Joined: 24/07/2007 16:16:22
Messages: 10
Offline
|
Hey marc, thx for fixing
but there's the same error at
http://ws.geonames.org/postalCodeSearch?style=SHORT&maxRows=10&postalcode_startsWith=300
and why find
http://ws.geonames.org/postalCodeSearch?style=SHORT&maxRows=10&placename_startsWith=
a result from the first character:
http://ws.geonames.org/postalCodeSearch?style=SHORT&maxRows=10&placename_startsWith=n
but this give a error:
http://ws.geonames.org/postalCodeSearch?style=SHORT&maxRows=10&postalcode_startsWith=0
|
|
|
19/08/2007 23:10:38
|
marc
Joined: 08/12/2005 07:39:47
Messages: 4412
Offline
|
Hi Larry
I fixed these problems. let me know if there is anything else.
Cheers
Marc
|
|
|
|
20/08/2017 18:07:11
|
Javier Reinoso
Joined: 24/12/2009 15:24:57
Messages: 2
Offline
|
One important question:
Only is Possible with startsWith?
Is not possible any how this for London, for example:
*ondo
Is only possible with the first letters, not any place that contain some letters?
For example if search for *ondo*? do results and one are London
In some countries with strange names is possible not know the first exactly letters, only some letters...
Thanks in advance for answer...
|
|
|
|