开发者

YQL response null when it *shouldn't* be

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.


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.


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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜