No address for entities returns via keyword search?

1 view
Skip to first unread message

Mahmoud

unread,
Dec 17, 2009, 4:40:54 PM12/17/09
to GeoAPI
A prevalent use case for keyword search is to auto-complete when a
user starts typing a business name. However, the results returns by
the keyword-search API do not included address, just the business
name.

So now I'd have to resort to getting all the guids for the returned
businesses and query for their address serially, which takes a lot
longer than I'd like.

Any chance I could get entity addresses in the keyword-search api?

Cheers,
Mahmoud

Elad Gil

unread,
Dec 17, 2009, 8:10:49 PM12/17/09
to geo...@googlegroups.com
Hi Mahmoud,
Thanks for pointing this out.  Let me circle with the team.
Elad

Othman

unread,
Dec 17, 2009, 8:32:14 PM12/17/09
to GeoAPI
Hi Mahmoud,

Two possibilities:

1) User prefix operator: If you're autocompleting based on a prefix,
the easiest would be to use the MQL search with a prefix operator
(^=). For example, if you wanted to search for businesses that start
with "The" from a point in San Francisco, you could use the following
query (just paste it into the query tool: http://api.geoapi.com/demos/mql_tool/query.html):
{
"lat": 37.75629
"lon": -122.4213
"radius": "1km"
"entity": [{
"guid": null
"type": "business"
"view.listing": {
"address": []
"name^=": "The"
"name": null
}
}]
}


2) Multi-query request: We will also soon be releasing the ability to
do multiple queries in a single request (basically an 'OR' operation).
In this case, you will be able to use the keyword search tool to get
the matching guids and then do another request to get the addresses.
This ends up being two queries, but still grants you the usefulness of
the keyword search.

I hope this helps.

-Othman

Mahmoud

unread,
Dec 18, 2009, 12:51:22 AM12/18/09
to GeoAPI
MQL search seems to restrict search to a 1 km radius. This is too
small to cover a city like Boston.

So I guess I'm restricted to option #2. For now, I can implement this
in my server proxy, so that it would be one call from the client/js
side. I hope the connection between Google App Engine and GeoAPI is
fast!

-Mahmoud

Othman

unread,
Dec 18, 2009, 1:21:40 AM12/18/09
to GeoAPI
That sounds reasonable. With regards to the radius restriction, we'll
soon be increasing the range (or removing the restriction altogether),
so stay tuned for that.

-Othman

Reply all
Reply to author
Forward
0 new messages