YQL 响应 null 当它“不应该”时

发布于 2024-10-11 04:20:33 字数 873 浏览 6 评论 0原文

使用 http://jobs.sitesixteen.com/ 作为参考。

我使用 YQL 来自动完成城市、州。如果您输入“san”,则 来自 YQL 的响应为 null。我发现奇怪的是,如果您输入“los”,则 YQL 的响应按预期返回结果。

这是一个格式错误的查询,我只是没有看到它,还是雅虎端的某些内容?

一如既往,我们感谢任何帮助。

Use http://jobs.sitesixteen.com/ for reference.

I'm using YQL for the city, state auto-complete. IF you type "san", the response from YQL is null. The odd thing I find is that if you type "los", the response from YQL returns results as expected.

Is this a badly formed query and I'm just not seeing it, or something on Yahoo's end?

As always, any help is appreciated.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

怼怹恏 2024-10-18 04:20:33

这是我从雅虎的埃迪·巴布科克那里收到的回复!

此请求包含远程过滤器 (text="san*") 和本地过滤器 (country.code="US")。远程过滤器调用一个 Web 服务,尝试查找世界上所有以“san”开头的城镇地名,但由于数量太多,因此发生超时,并且没有返回结果。您需要对文本值更有选择性(添加更多起始字符),以允许 Web 服务完成请求。 “los*”之所以成功,是因为世界上以“los”开头的城镇较少。

这仍然让我相信这是他们实施方式的问题,但至少这个问题现在已经解决了。

This is a response I received from Eddie Babcock of Yahoo!

This request contains a remote filter (text="san*") and a local filter (country.code="US"). The remote filter invokes a web service that tries to find all town place names in the world that begin with "san", but because there are so many, a timeout occurs, and no results are returned. You will need to be more selective in your text value (add more starting characters) to allow the web service to complete the request. "los*" succeeds because there are fewer towns in the world that start with "los".

Which still leads me to believe it's an issue with the way they've implemented it, but at least this question is now resolved.

寂寞笑我太脆弱 2024-10-18 04:20:33

您没有提供足够的信息。

请注意,通过使用 san 手动填充 该特定网站 上的 State 字段,它永远不会返回一个清单。

通过将查询修改为 san f(SAN 空间 F),它将返回预期结果。

http://query.yahooapis.com/v1/public/yql?callback=jsonp1294734397302&q=select+name,admin1.code+from+geo.places+where+text%3D%22san%20f*%22+and+country.code%3D%22US%22+limit+10+|+sort(field%3D%22popRank%22,+descending%3D%22true%22)&format=json&callback=cbfunc

编辑

该网站就是这样设计的。这是来自 jQuery 函数的注释,该函数为下拉列表拉回数据。它解释了查询背后的逻辑。

// 从 geo.places 中选择名称,admin1.code,其中 text="medf*" 和country.code="US" limit 10 | sort(field="popRank",scending="true")

注意它是如何限制为 10 的吗?

输入返回超过 10 个结果的搜索词将不会返回任何结果。输入 san 会产生超过 10 个结果,因此不会返回任何结果,而输入 los 将返回 3 个结果。

这与 YQL 不一致无关。

You aren't providing enough information.

Notice that by manually populating the State field on that particular website with san it never returns a list.

By modifying your query to san f (SAN space F) it will return the expected results.

http://query.yahooapis.com/v1/public/yql?callback=jsonp1294734397302&q=select+name,admin1.code+from+geo.places+where+text%3D%22san%20f*%22+and+country.code%3D%22US%22+limit+10+|+sort(field%3D%22popRank%22,+descending%3D%22true%22)&format=json&callback=cbfunc

EDIT

The site is designed this way. This is a comment from the jQuery function that pulls the data back for the drop down list. It explains the logic behind the query.

// select name,admin1.code from geo.places where text="medf*" and country.code="US" limit 10 | sort(field="popRank", descending="true")

Notice how it's limited to 10?

Entering a search term that returns more than 10 results won't return any results. Entering san produces more than 10 results so won't return anything where as entering los returns 3 results.

It isn't to do with inconsistencies in YQL.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文