什么是调整我的Foursquare API搜索查询的最好方法?[英] What's the best way to tune my Foursquare API search queries?

本文是小编为大家收集整理的关于什么是调整我的Foursquare API搜索查询的最好方法?的处理/解决方法,可以参考本文帮助大家快速定位并解决问题,中文翻译不准确的可切换到English标签页查看源文。

问题描述

我从Foursquare的地点搜索API中获得了一些不稳定的结果,我想知道是否有人有任何有关如何处理最直观的结果的输入参数的提示.

例如,假设我正在搜索一个名为" Ise Sushi"的场地,"纽约,纽约",相当于(LAT:40.7143528,LON:-74.005973099999999)使用Google Map API.插入Foursquare场地API,我们得到:

https://api.foursquare.com/v2/venues/search?query=ise%20sushi&ll=40.7143528%2C-74.00597309999999

这产生了很大的结果:我正在寻找的场地在排名第11位的榜单上相当远.有趣的是,降低坐标的精度似乎会产生更好的结果.例如,假设我们要将坐标舍入至3个重要数字:

https://api.foursquare.com/v2/venues/search?query=ise%20sushi&ll=40.7%2C-74.0

这次,我正在寻找的场地最终排在第二位,即使它实际上是远离搜索中心(1072米,使用第一个查询的833米) ).

似乎有助于提高搜索质量的另一种修改是替换空间将我们的搜索词分开.例如,这是下划线的原始查询:

https://api.foursquare.com/v2/venues/search?query=ise_sushi&ll=40.7143528%2C-74.00597309999999

这产生了最直观的结果结果:我要寻找的场地首先出现,并伴随着另一个结果,即" ISE餐厅"(被标记为"寿司餐厅").就其价值而言,这实际上似乎是结果设置在Foursquare自己的网站上进行的相同搜索

我很好奇我应该从中学习什么.我应该降低坐标的精度吗?我应该将搜索术语与下划线连接起来,如果是这样,这是否限制了用户如何订购其搜索术语?

推荐答案

尽管我们可以在我们结束时进行排名改进以找到这种遥远的确切匹配,但通常也有助于指定意图=浏览(尽管在这种情况下,现在可能会使您更糟结果).默认情况下,/场地/搜索使用Intent = CheckIn,它非常困难地找到近距离的匹配项以进行检查,而牺牲了其他场所可能与您的搜索相匹配的方式.在 https://developer.foursquare.com/docs/docs/venues/venues/search/search /p>

本文地址:https://www.itbaoku.cn/post/2090857.html

问题描述

I'm getting some erratic results from Foursquare's venue search API and I'm wondering if anyone has any tips on how to process my input parameters for the most "intuitive" results.

For example, suppose I am searching for a venue called "Ise Sushi", around "New York, NY", which is equivalent to (lat: 40.7143528, lon: -74.00597309999999) using Google Maps API. Plugging into the Foursquare Venue API, we get:

https://api.foursquare.com/v2/venues/search?query=ise%20sushi&ll=40.7143528%2C-74.00597309999999

This yields pretty underwhelming results: the venue I'm looking for ends up rather far down the list, at 11th place. What's interesting is that reducing the precision of the coordinates appears to produce much better results. For example, suppose we were to round the coordinates to 3 significant digits:

https://api.foursquare.com/v2/venues/search?query=ise%20sushi&ll=40.7%2C-74.0

This time, the venue I'm looking for ends up in 2nd place, even though it is actually farther from the center of the search (1072 meters, vs. 833 meters using the first query).

Another modification that appears to help improve the quality of search is substituting underscores for spaces to separate our search terms. For example, here's the original query with underscores:

https://api.foursquare.com/v2/venues/search?query=ise_sushi&ll=40.7143528%2C-74.00597309999999

This produces the most intuitive-seeming results: the venue I'm looking for appears first, and is accompanied by just one other result, "Ise Restaurant" (which is tagged as a "sushi restaurant"). For what it's worth, this actually seems to be the result set of the same search conducted on Foursquare's own website.

I'm curious what lessons I should be learning from this. Should I be reducing the precision of my coordinates? Should I be connecting my search terms with underscores, and if so, does that limit how a user can order their search terms?

推荐答案

Although there are ranking improvements we can make on our end to find this distant exact match, it generally also helps to specify intent=browse (although it looks like in this case, for now, it may give you worse results). By default, /venues/search uses intent=checkin, which tries really hard to find close-by matches for checking in to, at the expense of other ways a venue might match your search. Learn more at https://developer.foursquare.com/docs/venues/search