Barthy
Barthy

Reputation: 3231

Google Places API: Less results if filtering by more types (and vice versa)

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

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

Answers (2)

Bhanu Birani
Bhanu Birani

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

Barthy
Barthy

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

Comment on bug report from Sep 1, 2014

which solves my problem in a few words. I wish the docs had stated this.

Upvotes: 0

Related Questions