|
|
|
Interesting this query has the "any" license set but returns 511 results:
All that changed is the site searched against. It seems Yahoo aren't consistent in their handling of the matter. This issue should have been fixed for the 1.5 release.
It seems that in Zend Framework 1.5.1, the problem is still not solved.
The following code does not return any results: // Zend Framework 1.5.1
include_once 'Zend/Service/Yahoo.php';
$yahoo = new Zend_Service_Yahoo('YAHOO_ID');
$results = $yahoo->webSearch('mysql', array('site' => 'www.php.net'));
foreach ($results as $result)
{
echo $result->Title . '<br />';
}
echo "<hr />";
Removing the ", array('site' => 'www.php.net')" part of "webSearch" and executing again, returns results. I personally think that Zend_Service_Yahoo::webSearch, with the 'site' option is a great way to implement a "site search" feature on anyway. All the testing I've done suggests there's an inconsistency at Yahoo's end. I think "fixing" it in ZF will be more a case of adding workarounds and exceptions to wrangle the results when we hit bad resultsets like mysql on php.net.
This doesn't appear to have been fixed in 1.5.0. Please update if this is not correct.
@ Jonathan Maron
AFAIK nothing has been done to fix the issue for ZF 1.5 thus it's normal the issue still appears. If I have a few minutes in the next days I'll give it a look. Simone, could you please look at this and fix the bug or close the issue? Time to get some closure.
Thanks! Hi all,
The license parameter causes problems. I tested the Yahoo web search service from my browser using the following URI: IMO, this should return the results from IMDB but it returns only results from Digg, which the license option ('license=any') does not work correctly. When license parameter is not used at all, the correct results are returned - try this: Therefore, I think that the "license" option should be removed from $defaultOptions for now, until Yahoo guys fix this problem. Thanks, |
||||||||||||||||||||||||||||||||||||||||||||||
Here's a few notes:
This is the URI queried by Zend_Service_Yahoo
http://search.yahooapis.com/WebSearchService/V1/webSearch?type=all&start=1&language=en&license=any&results=10&format=any&site=www.php.net&appid=API_KEY&query=mysql
I tried to remove each default parameter and I discovered license parameter can cause some problem when site is not empty, even if any is the default value.
I would suggest to remove the default value and left the parameter empty.