Reputation: 3231
My applications shows nearby places by using the Google Places Web API.
The user has control over the place types searched in the requests.
Multiple types are concatenated with the pipe symbol |
. I use &rankby=distance
, because prominence does not matter for the app.
I have noticed, that requesting nearby places with "a lot" of types returns less results than filtering by a single type.
Example
returns 10 results near where I live:
&types=airport|bank|bar|bicycle_store|book_store|bus_station|casino|cafe|city_hall|clothing_store|food|furniture_store|grocery_or_supermarket|gym|hardware_store|library|liquor_store|movie_theater|museum|night_club|park|place_of_worship|police|post_office|restaurant|school|shoe_store|shopping_mall|spa|stadium|store|subway_station|train_station|university|zoo
returns 20 results and a next_page_token
(so at least 20 results):
&types=store
I happen to live across a shopping mall, so I know for sure that there are more than 20 stores nearby. The first query contains store
as a filter, too.
Questions
I would like to always show as many results as possible. Has anybody experienced the same issue? Is there any document that I did not see, anything on this topic?
I'm a bit lost, since I don't know where to start looking or how to approach this problem.
Upvotes: 0
Views: 346
Reputation: 1286
Be aware that searching for more than one type at a time is deprecated. See http://googlegeodevelopers.blogspot.com.au/2016/02/changes-and-quality-improvements-in_16.html:
Beginning Feb 16, 2016, we are replacing the types restriction parameter with a new type search parameter. If you have been using the types parameter for Nearby Search, Text Search or Radar Search you will be affected.
Type search works similarly to types restriction, but it only supports one type per request.
Requests using the types parameter and those specifying multiple types (for example, types=hospital|pharmacy|doctor) will continue to return results until Feb 16, 2017, but we do not recommend using multiple types in a search request. After that date, requests with multiple types will no longer be supported. To ensure the best possible search results for your users, we recommend using a single type in search requests.
Upvotes: 1
Reputation: 3231
Thanks to @AndrewR 's comment, I stumbled upon a comment on an issue, that states the following:
[Google Places API does not] support specifying more than 20 types at a time
which solves my problem in a few words. I wish the docs had stated this.
Upvotes: 0