Restrict Google Places API search by type - api

I am performing a query using Google Places API to search for local restaurants
https://maps.googleapis.com/maps/api/place/nearbysearch/json?location=..lat,..lon&radius=..radius&type=restaurant&key=..key
However, I am receiving a lot of results for locations that are not primarily restaurants, for example:
Popular hotels with restaurants
Food delivery services
Night clubs
Department stores with dining
etc.
Ideally I would like to restrict my query to only a few types or prohibit certain types by query. Otherwise I would need to do this manually or find another service.

Just add the city name as a prefix in the search string. It will only give the search suggestions in which the user is searching.
eg, pass "NewYork" as a prefix in your search string, now type any word, it will only give you results for NewYork city restaurant, cafes, places, etc

Related

What is the most performant way to build and execute a multiple where clause in SQL from a single table of identifiers?

Here's the challenge. Users want to be able to create filters based on N-criteria and the criteria being used for the filter is a fluid heirarchy. To simplify it, let's use two hierarchies that the user could select from:
All Territories
Europe
UK
France
Americas
US
Canada
Mexico
Media
Music
Downloads
CDs
Movies
Streaming
DVD
Objects would have a table of tags associated with them. The ObjectsTags table would contain an indicator as two which type of data the tag is linked to
The issue is that user would want to select and group the tags they want to filter by. So they might want Movies in Europe so they would select those three tags as a single grouped filter. It's easy enough to get a filter based on those three tags that says:
Any object that has a tag of: (All Territories OR Europe OR UK or FRANCE) AND (All Media OR Movies OR DVD OR Streaming). The challenge is that I need to support any number of new hierarchies that might be needed and any level of filters, since a user could also want a filter that returns everything from that filter as well as all of the CDs in the US.
Is there any new feature in SQL Server that would be better suited for handling this type of a where clause in a performant way?
You are either going to have to create your where clause dynamically, or you will pre-create the SQL using a where clause similar to the following:
where country = coalesce(p_country, country)
and media = coalesce(p_media, medias)
and music = coalesce(p_music, music)
The really cool part of this statement? Your performance will be the
worst that it can possibly be.
I recommend creating a dynamic statement with the specific conditions you need.

Elasticsearch Search by popular names

As many cities are known by their common/popular names like Madras is still used to search instead of chennai, same for gurgaon. I have cityindex where I have stored documents containing city info, I wan't to search for documents based on their common names. What should be the best approach for the same ?

Query User by City using the Soundcloud Web API

Is it possible to fetch users by city or country? I would like to create something very local!
I've checked the available documentation but fail to see any solution to this, so this is a final stretch.
The City and Country properties are not searchable with the provided q parameter in the API, and as this searches over username / description and title you'd return a large number of false positives if it could.
It's unlikely you could over select as mentioned in the comments, as there are just too many users to pull down and then parse.

OpenERP customers separation

Please I would like to know ho to separate customers in category, since we have two type of customers, the first group should only appear in crm->customers only and vice versa to avoid having a huge list of customers when searching.
My first attempt is to add a tag to different customers to separate them, for example the crm customers have the tag name Mass mailing is it correct to achieve this with tags ?? and my second question how to set default search keyword for example if I click on sales -> customers how to set the default value of search box to for example crmOnly tag thanks.
you can use "domain" where ever you want to have a such a separation.

Google Places API: Using Multiple Name Parameters in the Places Search

I've been reading the documentation at: http://code.google.com/intl/nl/apis/maps/documentation/places/#PlaceSearches
But How do I modify the Place Search Request (shown below) so that I can limit the results to specific businesses only.
https://maps.googleapis.com/maps/api/place/search/json?location=-33.8670522,151.1957362&radius=500&types=food&name=harbour&sensor=false&key=AIzaSyAiFpFd85eMtfbvmVNEYuNds5TEF9FjIPI
For example in the above code it hastypes=food&name=harbour as two of the parameters. How can I include just "bakery" and "cafe" (both are supported list types) as the types parameter and then include multiple name parameters as well.
In bigger cities it may come back with 20 or so results, but I want to limit it to a handful of businesses that I have agreements with and just show their names on the map. I don't want Starbucks to come back so I want to restrict it to just the 8-10 businesses that I have the agreements with. Their names will be stored in a database so I can easily retrieve them and pass them into the HTTP URL, but I don't know how to do multiple names and get them all to show up on the map at the same time.
Any links to tutorials that can help or your ideas and suggestions would greatly help!
You can include types "bakery" and "cafe" by modifying your request parameter types=food|bakery|cafe add more types separate by "|" operator
for supported type list refer Link