简体   繁体   中英

Android: Filter google places search results

I'm working on my first android application that uses the Google Places API. The issue I'm running into is that I don't know how to filter out the search results to only show the particular places I want and not everything within that type. For example, say I had a list of specific type of restaurant across the country and I wanted to only show those particular places how would I filter out those results for just the ones I wanted to show in my application. So say I wanted Italian restaurants but not just any random one, I want to display the ones that were part of a particular restaurant group or by a specific chef. Is there a way I can filter out just those if I have a list of their locations already? Thanks!

There is no exact way to do this with the Places API. You could possibly pass the restaurant group or chef name as a keyword parameter in your request. As the documentation states, the keyword parameter is:

A term to be matched against all content that Google has indexed for this Place, including but not limited to name, type, and address, as well as customer reviews and other third-party content.

If you also have the places you could try match the locations with the ones returned from your search, but this may not be reliable as the exact location Google has for the place may differ from the location you have for the place.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM