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
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
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