Closed huidi7 closed 8 years ago
@huidi7 ,
"region": {
"span": {
"latitude_delta": 0.11800734735085427,
"longitude_delta": 0.11127506533881615
},
"center": {
"latitude": 47.611883296658704,
"longitude": -122.335993324846
}
},
Could you show an example of this changing when you change radius_filter?
"center": {
"latitude": 47.6056773643747,
"longitude": -122.22232894999999
}
which is pretty close to the "ll" location, and shows the search results.
Thank you for your clarification @mittonk.
Another question on the sort rule for the search API: when I search McDonald's by distance, the returned result seems nothing to do with it.
For example, https://api.yelp.com/v2/search/?term=McDonalds&sort=1&ll=47.634832478669644,-122.04643455929276
If I search McDonald's by best matches, what is the ranking rule for the these items with same name as "McDonald's"?
@huidi7 : Hm, the distance sort looks to be working for me for that search. Here's the URLs and distances I see:
{
"region": {
"span": {
"latitude_delta": 0.06261309999999298,
"longitude_delta": 0.11303551437529791
},
"center": {
"latitude": 47.643390600000004,
"longitude": -122.08496242073849
}
},
"total": 40,
"businesses": [
{
...
"url": "http://www.yelp.com/biz/mod-pizza-sammamish-4?adjust_creative=sWc_ig2aihT0s-6Yf-zGIQ&utm_campaign=yelp_api&utm_medium=api_v2_search&utm_source=sWc_ig2aihT0s-6Yf-zGIQ",
"distance": 2274.4259784520195
},
{
...
"url": "http://www.yelp.com/biz/mcdonalds-sammamish?adjust_creative=sWc_ig2aihT0s-6Yf-zGIQ&utm_campaign=yelp_api&utm_medium=api_v2_search&utm_source=sWc_ig2aihT0s-6Yf-zGIQ",
"distance": 2342.5542354754707
},
{
...
"url": "http://www.yelp.com/biz/whole-foods-market-redmond?adjust_creative=sWc_ig2aihT0s-6Yf-zGIQ&utm_campaign=yelp_api&utm_medium=api_v2_search&utm_source=sWc_ig2aihT0s-6Yf-zGIQ",
"distance": 5148.3660172705395
},
...
That's in nice distance order. If you're seeing something different, could you provide the output you see?
As to "Best Match": That looks at review content, name, and many other factors. It's not just a name match.
Does that answer your questions?
@mittonk yes, the distance order is right. I just wonder why the name of the first one is not "McDonald's" ? Or how can I get all the McDonald's ranked by distance?
"businesses": [ { "is_claimed": true, "rating": 3.5, "mobile_url": "http://m.yelp.com/biz/mod-pizza-sammamish-4?adjust_creative=7OM7gFZOwEDszaTgrAM8wg&utm_campaign=yelp_api&utm_medium=api_v2_search&utm_source=7OM7gFZOwEDszaTgrAM8wg", "rating_img_url": "https://s3-media1.fl.yelpcdn.com/assets/2/www/img/5ef3eb3cb162/ico/stars/v1/stars_3_half.png", "review_count": 43, "name": "MOD Pizza", ... "distance": 2274.4259784520195 },
Yelp Search isn't a simple name lookup --- it takes into account review text and a variety of other signals.
If you're only looking for businesses named exactly "McDonald's", I'd suggest post-filtering the results.
Hi,
I'm using yelp api for restaurant search. Could you please help to shed some lights on the following questions?
Thanks,