Local Search Follow
If you're planning on using the Local Search API in the iOS or Android SDKs, it's important to understand its limitations.
Overview
The Local Search API is designed to return a set of Placemarks relative to a given location. For example, if a mall has 50 restaurants, or an Airport has 100 stores, then Local Search is a great way to find the 5 results that are closest to the User's current location.
Alternatively, you can use Local Search to return the closest results to a specified location that is not where the user is located. For example, if a museum would like to show the 3 closest exhibits to the exhibit the user is currently viewing in the museum's app, while not at the museum, then Local Search is a great option.
Limitations
However, there are limitations to how Local Search can be used. If a query is too broad, then some expected results may not be returned. The main reason is that the performance of the Google Search API, the API that backs our search features, degrades exponentially after about 20 results. At first glance, requesting 5 or 10 results would seem to be well within this limit, but Local Search is a little bit more complicated.
The way Local Search works is that it takes the results from a search query and then calculates the distance to each result from the requested starting point. Given the underlying Google performance issues, we limit the internal results to 250. So if those initial results do not include the closest Placemarks, then the closest placemarks will not be returned. For example, if an office complex has 500 conference rooms, there's no guarantee the closest conference rooms for a generic query like "conference room" will be included in the results.
Writing Specific Queries
In order to get the results you'd expect, it's important to limit your initial query to something more specific. For example, you could search for the nearest conference rooms on the current floor, or in the current building, or for conference rooms of a given size (you'd have to add room size as a property to all your conference rooms first). In order to write a more specific query, you'll need to use Google's search syntax.
For example, here's a query for all conference rooms in Building 123 that match the string "ABC" (in the name, description, or other text fields):
type:conference_room group_id:123 ABC
Here's another example limiting the same query to just Floor 123:
type:conference_room map_id:123 ABC
Comments
0 comments
Please sign in to leave a comment.