views:

10

answers:

0

Hi

I'm trying to implement an autosuggest where users can type in a country, colloquial name, continent or super name (ie scandinavia). I've got the webservice working for exact matches at this url:

http://where.yahooapis.com/v1/places$and(.q('united states'),.type(29,12,19,24));start=0;count=5?format=json&appid=API_KEY_HERE

(29, 12, 19, 24 correspond to the four place types I want to limit my search to)

That's all fine, and works if the query is 'thai' (to match Thailand) but not when the query is 'united sta' or 'great bri'. The API doc says:

For a "startswith" filter, specify the place as a string followed by an asterisk (*), encoded as %2A

So I change my url:

http://where.yahooapis.com/v1/places$and(.q('united sta*'),.type(29,12,19,24));start=0;count=5?format=json&appid=API_KEY_HERE

And get no results.

It seems that the * approach works when not specifying place types - but I need to limit searches to those four types.

Has anyone managed to do partial searches while limiting place types?

Thanks, Adam