0

Auto generate address from text input

Hey,
New to YQL and struggling to find a query to match my needs.
I would like to create an auto generation of the full address once a user starts typing their location in one text box.
I can do all the javascript so its just the YQL query that I'm struggling with if anyone can help or has done something similar.

So a working example is a full address "15 pennine drive london"
select * from geo.placefinder where text="15 pennine drive london" AND country = "United Kingdom"
Great result from this query

So if I type in just "15 pennine drive" I need several results of similar locations
select * from geo.placefinder where text="15 pennine drive" AND country = "United Kingdom"
This provides a NULL result
This doesn't work either as LIKE is not supported for the text field
select * from geo.placefinder where text LIKE "%15 pennine drive%" AND country = "United Kingdom"

If anyone has got a working example or can point me in the direction it would be great.

Thanks

by
1 Reply
  • QUOTE (roberts.glyn@... @ Oct 10 2010, 09:43 PM) <{POST_SNAPBACK}>
    Hey,
    New to YQL and struggling to find a query to match my needs.
    I would like to create an auto generation of the full address once a user starts typing their location in one text box.
    I can do all the javascript so its just the YQL query that I'm struggling with if anyone can help or has done something similar.

    So a working example is a full address "15 pennine drive london"
    select * from geo.placefinder where text="15 pennine drive london" AND country = "United Kingdom"
    Great result from this query

    So if I type in just "15 pennine drive" I need several results of similar locations
    select * from geo.placefinder where text="15 pennine drive" AND country = "United Kingdom"
    This provides a NULL result
    This doesn't work either as LIKE is not supported for the text field
    select * from geo.placefinder where text LIKE "%15 pennine drive%" AND country = "United Kingdom"

    If anyone has got a working example or can point me in the direction it would be great.

    Thanks


    The geo.placefinder table does not support the capability you desire. You need to include a city name in the query text if you provide a street name. Also, it is better to include the country name in the query text. In your example request, country is used to filter out results that do not include an response element with the indicated value, which is case-sensitive. The text field is case-insensitive and tolerant of misspellings. Here is an equivalent YQL query:

    select * from geo.placefinder where text="15 pennine drive london united kingdom"

    Eddie Babcock
    Yahoo! Geo Technologies
    0

Recent Posts

in YQL