I wrote Yii API Open Search plug-in for Firefox and (as I knew later) for IE.
https://addons.mozilla.org/ru/firefox/addon/254552/
Here are screenshots:
in IE: http://img571.imageshack.us/img571/7951/ieyii.png
in FF: http://img42.imageshack.us/img42/5781/yiiscreen2.png
But Yii site not provides results for OpenSearch in proper format.
That`s why I wrote interfase for Yii suggester.
<?php
ob_start("ob_gzhandler");
header("Content-Type: text/html; charset=utf-8");
function make_response($content)
{
$title = $desc = $url = array();
$qa = explode("\n",$content);
foreach($qa as $value)
{
$exploded = array();
$title[] = $value;
$exploded = explode('.',$value);
$desc[] = $exploded[0];
$str = "";
$str = 'http://www.yiiframework.com/doc/api/1.1/'.$exploded[0];
if(count($exploded) == 2)
{
$str .= '#'.trim($exploded[1],'()').'-detail';
}
$url[] = $str;
}
return '["'.$_GET['q'].'",["'.implode('","',$title).'"],["'.implode('","',$desc).'"],["'.implode('","',$url).'"]]';
}
if(!empty($_GET['q']))
{
$link = "http://www.yiiframework.com/api/suggest/?q=".urlencode($_GET['q']).'&limit=100×tamp='.time();
$ch = curl_init ();
curl_setopt ($ch , CURLOPT_URL , $link);
curl_setopt ($ch , CURLOPT_RETURNTRANSFER , 1 );
$content = curl_exec($ch);
echo make_response($content);
}
ob_end_flush();
?>
Temporary hosted on another site and you can see output here: http://www.z-zag.com/suggest.php?q=Form
Can you help me with host this suggester, or make special suggester page in yii official site to make it more stable.
And the second wish is to redirect from search page if it is the only result for query.
Example: http://www.yiiframework.com/search/?q=CActiveDataProvider.getCriteria()&type=api-suggest
Because of in IE plugin works correctly and goes to defined page straightly. But in FF searcer can`t do it, and redirects to search page.
OPENSEARCH suggestions specification: http://www.opensearch.org/Specifications/OpenSearch/Extensions/Suggestions/1.1
P.S.> Sorry for long post and my english.