为什么名称完全匹配会返回无用的场所? [英] Why does an exact match on a name return a useless set of venues?

查看:74
本文介绍了为什么名称完全匹配会返回无用的场所?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这对我来说意义不大,我希望有人可以阐明这里发生的事情以及我如何解决它.

如果我这样查询:

解决方案

我不确定这是否有帮助,但是我发现在查询中的单词之间放置和"可以产生更准确的结果:

搜索Chili's Bar&烧烤

第一个查询有无关的结果:

https://api.foursquare.com/v2/venues/search?ll=34.07527923583984,-84.29469299316406&radius=5000&query=辣椒的酒吧烧烤& oauth_token = xxx& v = 20111205

第二个要准确得多(尽管我删除了&符:&)

https://api.foursquare.com/v2/venues/search?ll=34.07527923583984,-84.29469299316406&radius=5000&query=辣椒和酒吧和烧烤店& oauth_token = xxx& v = 20111205

This doesn't make much sense to me, and I'm hoping someone can shed some light on what's going on here and how I work around it.

If I query like this:

https://api.foursquare.com/v2/venues/search?ll=37.77%2C-122.41&radius=15000&intent=browse&oauth_token=xxx&limit=20&query=pi%20ba

I get a list of about 15 items, including the item I'm searching for (pi bar). However, if I search for the exact match name:

https://api.foursquare.com/v2/venues/search?ll=37.77%2C-122.41&radius=15000&intent=browse&oauth_token=xxx&limit=20&query=pi%20bar

I just get back the blanket list of venues within this area (mostly BART stops, etc.)

Is it expected that I should have to shave the last character off of user entered queries to get results back, or is this just a messed up venue name that I've been debugging with?

解决方案

I'm not sure if this may help, but I've discovered placing an "and" between words in your query can produce more accurate results:

Searching for Chili's Bar & Grill

The first query has extraneous results:

https://api.foursquare.com/v2/venues/search?ll=34.07527923583984,-84.29469299316406&radius=5000&query=chili's bar grill&oauth_token=xxx&v=20111205

The second is much more accurate (although I've removed the ampersand: &)

https://api.foursquare.com/v2/venues/search?ll=34.07527923583984,-84.29469299316406&radius=5000&query=chili's and bar and grill&oauth_token=xxx&v=20111205

这篇关于为什么名称完全匹配会返回无用的场所?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆