<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Think Again &#187; Google-ajax-search</title>
	<atom:link href="http://www.thinkagain.cn/archives/tag/google-ajax-search/feed" rel="self" type="application/rss+xml" />
	<link>http://www.thinkagain.cn</link>
	<description>Inspire thinking, inspire creativity, inspire future.</description>
	<lastBuildDate>Wed, 01 Feb 2012 07:31:56 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>如何使用本站站内搜索</title>
		<link>http://www.thinkagain.cn/archives/751.html</link>
		<comments>http://www.thinkagain.cn/archives/751.html#comments</comments>
		<pubDate>Fri, 05 Oct 2007 12:02:15 +0000</pubDate>
		<dc:creator>山之岚</dc:creator>
				<category><![CDATA[Blogger]]></category>
		<category><![CDATA[Google-ajax-search]]></category>
		<category><![CDATA[Wordpress]]></category>

		<guid isPermaLink="false">http://www.thinkagain.cn/archives/751.html</guid>
		<description><![CDATA[站点文章一多，无形中增大了浏览者查找自己所要内容的难度。虽说Wordpress内置的搜索功能，但其效率实在是不敢恭维。前一阵子，花了点时间，采用Google ajax search的api重新打造了站内搜索。... ]]></description>
			<content:encoded><![CDATA[<p>站点文章一多，无形中增大了浏览者查找自己所要内容的难度。虽说Wordpress内置的搜索功能，但其效率实在是不敢恭维。前一阵子，花了点时间，采用Google ajax search的api重新<a href="http://www.thinkagain.cn/archives/722.html" target="_blank">打造了站内搜索</a>。由于Google采用的是关键字搜索技术，只要网页中包含关键字内容，就会被显示，大大提高了站内搜索的准确度。且Google除了可以进行站内文章搜索外，还可以支持网页，图片，博客，新闻，视频，乃至图书搜索。Google ajax search api还提供地图搜索功能，但个人以为此项功能对浏览者来说帮助不大，所以目前没有整合该功能。如果Google有发布新的search object api，将会视情况继续整合到站内搜索中。</p>
<p>侧边栏的上部就是站内搜索框。搜索框上面的一排小图标，提供了添加书签到各站点的功能，如Delicious、Google Bookmark、百度搜藏等，点击它们可将网页添加至相应站点。</p>
<p><img  height="103" alt="googleajaxsearch01" src="http://www.thinkagain.cn/wp-content/uploads/2007/10/googleajaxsearch01.jpg" width="297" /> </p>
<p>图1 搜索框</p>
<p>输入关键字，点击&quot;Search&quot;后，在网页左边菜单栏下面将会出现一个标签栏，并按标签显示搜索结果。请注意，除了第一标签固定显示为&quot;ThinkAgain站内搜索&quot;外，其余标签由Google根据根据您的浏览器语言设置来显示。如我的浏览器语言设置为en-us，全部显示为英文，如下图。</p>
<p><img height="33" alt="googleajaxsearch11" src="http://www.thinkagain.cn/wp-content/uploads/2007/10/googleajaxsearch11.jpg" width="430" /> </p>
<p>图2 标签显示为英文</p>
<p>浏览器语言设置为zh-cn的标签显示如图3。</p>
<p><img height="32" alt="googleajaxsearch12" src="http://www.thinkagain.cn/wp-content/uploads/2007/10/googleajaxsearch12.jpg" width="394" /> </p>
<p>图3 标签显示为中文</p>
<p>下面以在英文环境下为例，介绍如何使用本站站内搜索。在侧边栏的搜索框中，输入关键词&quot;x01ht&quot;，并点击&quot;Search&quot;。</p>
<p><img height="103" alt="googleajaxsearch02" src="http://www.thinkagain.cn/wp-content/uploads/2007/10/googleajaxsearch02.jpg" width="297" /> </p>
<p>图4 输入关键字&quot;x01ht&quot;并搜索</p>
<p>搜索结果将会显示在网页左部。默认显示的是&quot;ThinkAgain站内搜索&quot;，站中任何含有&quot;x01ht&quot;关键字的网页都会被显示在本标签页中。如搜索结果超过8个，在最后一行将文本显示&quot;More results&quot;，或&quot;更多结果&quot;的链接，点击该链接，将会新开Google搜索页面。</p>
<p><img height="449" alt="googleajaxsearch03" src="http://www.thinkagain.cn/wp-content/uploads/2007/10/googleajaxsearch03.jpg" width="430" /> </p>
<p>图5 ThinkAgain站内&quot;x01ht&quot;关键字搜索结果</p>
<p>点击&quot;Web&quot;或&quot;网络&quot;，将显示的是&quot;x01ht&quot;关键字的网页搜索结果。</p>
<p><img height="445" alt="googleajaxsearch04" src="http://www.thinkagain.cn/wp-content/uploads/2007/10/googleajaxsearch04.jpg" width="430" /> </p>
<p>图6 &quot;x01ht&quot;关键字网页搜索结果</p>
<p>点击&quot;Blog&quot;或&quot;博客&quot;，将切换到&quot;x01ht&quot;关键字的博客搜索结果。</p>
<p><img height="440" alt="googleajaxsearch05" src="http://www.thinkagain.cn/wp-content/uploads/2007/10/googleajaxsearch05.jpg" width="430" /> </p>
<p>图7 &quot;x01ht&quot;关键字博客搜索结果</p>
<p>点击&quot;Image&quot;或&quot;图片&quot;，将切换到&quot;x01ht&quot;关键字的图片搜索结果。很方便吧。</p>
<p><img height="445" alt="googleajaxsearch06" src="http://www.thinkagain.cn/wp-content/uploads/2007/10/googleajaxsearch06.jpg" width="430" /> </p>
<p>图8 &quot;x01ht&quot;关键字图片搜索结果</p>
<p>点击&quot;Video&quot;或&quot;视频&quot;，将类似地，将会显示&quot;x01ht&quot;关键字的视频搜索结果。视频的搜索结果，似乎以Youtube的居多。</p>
<p><img height="389" alt="googleajaxsearch07" src="http://www.thinkagain.cn/wp-content/uploads/2007/10/googleajaxsearch07.jpg" width="430" /> </p>
<p>图9 &quot;x01ht&quot;关键字视频搜索结果</p>
<p>当然，用&quot;x01ht&quot;作为关键字是搜索不出什么图书的，在侧边栏的搜索框中输入&quot;supply chain&quot;，然后回车。</p>
<p><img height="102" alt="googleajaxsearch09" src="http://www.thinkagain.cn/wp-content/uploads/2007/10/googleajaxsearch09.jpg" width="301" /> </p>
<p>图10 输入&quot;supply chain&quot;关键字搜索</p>
<p>点击标签栏上的&quot;Book&quot;或&quot;书籍&quot;，所有书名中含有&quot;supply chain&quot;的单词的书籍都会显示在搜索结果中。</p>
<p><img height="416" alt="googleajaxsearch08" src="http://www.thinkagain.cn/wp-content/uploads/2007/10/googleajaxsearch08.jpg" width="430" /> </p>
<p>图11 &quot;supply chain&quot;关键字图书搜索结果</p>
<p>想找点有趣的视频？输入&quot;need for speed&quot;，极品飞车，这可是我最喜爱的游戏之一，点search，再切换到视频，直接就可以看到极品飞车最新版的官方介绍视频了。遗憾，从carbon起，我的机子就再也跑不动极品飞车了。</p>
<p><img  height="407" alt="googleajaxsearch10" src="http://www.thinkagain.cn/wp-content/uploads/2007/10/googleajaxsearch10.jpg" width="430" /> </p>
<p>图12 &quot;need for speed&quot;关键字视频搜索结果</p>
<p>如上面的例子，Google ajax search api提供了强大的搜索接口，通过它，Blogger可免费利用Google的搜索技术来建立自己的站内搜索。有兴趣，自己也来打造一个吧。</p>
<p>本文除了可视为本站的站内搜索的使用向导外，亦可作为一篇Google ajax search在blog中的应用介绍。</p>
<hr/><p style="font-size:1.5em;font-weight:bold;"><a href="http://www.thinkagain.cn/archives/751.html#comments">评论7:</a></p><p><strong>7.</strong><i>2008.07.20.10:26.am</i>.&nbsp;<a href="http://3284265.cn/">shamas</a>: 强啊，试着搜了一下。不过感觉站内的那个已经够用了，我也不想改那些东东，凑合着用用呵</p><p><strong>6.</strong><i>2007.10.08.11:18.pm</i>.&nbsp;<a href="http://www.thinkagain.cn">山之岚</a>: WP是有Google ajax search插件，但是该插件只能将搜索结果显示在搜索框下面，个人觉得效果不大好。</p><p><strong>5.</strong><i>2007.10.08.9:30.pm</i>.&nbsp;<a href="http://heyi.name">Heyi</a>: Wordpress有这个插件的，呵呵。</p><p><strong>4.</strong><i>2007.10.08.6:34.pm</i>.&nbsp;<a href="http://ecvip.org/">oxygen</a>: 非常喜欢这个功能啊.

今天回深圳了,哪吒rss订阅我这几天间有156条博客文章未读,今天晚上有事做了...</p><p><strong>3.</strong><i>2007.10.06.3:13.pm</i>.&nbsp;<a href="http://www.thinkagain.cn">山之岚</a>: 现在Google收录网站的速度也很快了。比如，我昨晚发的这篇文章，刚才测试下，已经被Google收录了。</p><p><strong>2.</strong><i>2007.10.06.12:27.am</i>.&nbsp;<a href="http://www.thinkagain.cn">山之岚</a>: 当然用Google ajax search做站内整合，最重要的前提是你的网站必须已经被Google收录了。否则将不会有结果反馈的。其次就是要去申请一个api key！</p><p><strong>1.</strong><i>2007.10.06.12:17.am</i>.&nbsp;<a href="http://lxz.name">ddkk3000</a>: 如果网站没有被收录或者没有被立刻收录，这个功能怎么用呢</p><hr/><p style="font-size:1.5em;font-weight:bold;">推荐阅读</p><p><i>2007.09.16.11:49.pm</i>.&nbsp;<a href="http://www.thinkagain.cn/archives/722.html" title="周末，台风和九州擦肩而过，外面虽未刮强风，雨倒是下个不停。在家里继">利用Google Ajax Search进行站内搜索 (5)</a></p><p><i>2009.01.03.4:57.pm</i>.&nbsp;<a href="http://www.thinkagain.cn/archives/1031.html" title="English user please navigates to http://wordpress.org/extend/plugins/wp-smilies/&#160; for instruct">Wordpress插件: WP Smilies (49)</a></p><p><i>2008.12.19.12:20.am</i>.&nbsp;<a href="http://www.thinkagain.cn/archives/1030.html" title=" 有段时间没有写些技术类的文章了，（p.s，似乎其它文章也没多写。。。">12行代码给Wordpress主题挂上AJAX (35)</a></p><p><i>2008.12.07.9:51.pm</i>.&nbsp;<a href="http://www.thinkagain.cn/archives/1029.html" title=" 这一阵子，Google Friend Connect似乎闹得挺热乎的。周围的网友博客们纷纷在">Hot friends新增支持用户自定义头像显示 (65)</a></p><p><i>2008.10.27.9:52.pm</i>.&nbsp;<a href="http://www.thinkagain.cn/archives/1024.html" title="如题。将Hot friends和mailtocommenter插件分别更新到1.3.2和1.3版。

其中hotfriends">从更新hot friends和mailtocmmenter谈起 (33)</a></p><p><i>2008.09.09.8:58.pm</i>.&nbsp;<a href="http://www.thinkagain.cn/archives/994.html" title="今天，Wordpress官方发布了2.6.2版。没有跑去Trac看代码变动地方，直接就将程">Wordpress Hacks:WP2.2版后中文邮件标题乱码解决方法 (22)</a></p><p><i>2008.08.25.11:06.pm</i>.&nbsp;<a href="http://www.thinkagain.cn/archives/989.html" title="English user please navigates to http://wordpress.org/extend/plugins/mailtocommenter/ for instructi">Wordpress插件: Mail To Commenter v1.3.2 (377)</a></p><p><i>2008.08.20.8:11.pm</i>.&nbsp;<a href="http://www.thinkagain.cn/archives/987.html" title="假设您已经阅读过上文，对于此问题背景的来龙去脉有所了解。此文将正式">Wordpress Hacks:解决晒SPAM数无法通过W3C验证&#8230;续 (11)</a></p><hr/><p>Copyright &copy; 2012&nbsp;|&nbsp;<a href="http://www.thinkagain.cn">Think Again</a>&nbsp;|&nbsp;<a href="http://www.thinkagain.cn/archives/751.html">原文链接</a></p><img src="http://img.tongji.cn.yahoo.com/710673/ystat.gif"/>]]></content:encoded>
			<wfw:commentRss>http://www.thinkagain.cn/archives/751.html/feed</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
		<item>
		<title>利用Google Ajax Search进行站内搜索</title>
		<link>http://www.thinkagain.cn/archives/722.html</link>
		<comments>http://www.thinkagain.cn/archives/722.html#comments</comments>
		<pubDate>Sun, 16 Sep 2007 15:49:00 +0000</pubDate>
		<dc:creator>山之岚</dc:creator>
				<category><![CDATA[Blogger]]></category>
		<category><![CDATA[Google-ajax-search]]></category>
		<category><![CDATA[Wordpress]]></category>

		<guid isPermaLink="false">http://www.thinkagain.cn/archives/722.html</guid>
		<description><![CDATA[周末，台风和九州擦肩而过，外面虽未刮强风，雨倒是下个不停。在家里继续整理博客。今天已将Google ajax search成功整合进站内搜索。现在在侧边栏的搜索框内输入关键词搜索后，搜索结果将... ]]></description>
			<content:encoded><![CDATA[<p>周末，台风和九州擦肩而过，外面虽未刮强风，雨倒是下个不停。在家里继续整理博客。今天已将Google ajax search成功整合进站内搜索。现在在侧边栏的搜索框内输入关键词搜索后，搜索结果将会出现在博客页面左部分。</p>
<p>众所周知，wordpress自带的搜索并不精确，用Google adsense search固然可以调用Google进行站内搜索，但其代码却无法通过W3C验证，且搜索结果是显示在google页面而非博客页面。所以就想在自己的博客内调用google ajax search api来进行站内搜索。在<a href="http://codex.wordpress.org/Plugins/Search">wordpress plugin</a>上找到了一个Google ajax search插件，急忙装上去试用，发现效果很不好，将关键词输入搜索框进行搜索后，搜索框下面将弹出搜索结果。似乎直接照搬Google search API代码。</p>
<p>在百度上搜索google ajax search wordpress，第一个出现的就是Storyday博客的，“<a href="http://www.storyday.com/html/y2007/993_int-google-ajax-search-into-wp.html">集成google ajax search到你的wordpress blog中</a>”，结果参照他的文章及提供的代码，以及Google Search官方的帮助“<a href="http://code.google.com/apis/ajaxsearch/documentation/#Searchers">Google AJAX Search API Developer Guide</a>”，下午花了点时间，顺利搞定。自己又hack了一下代码，使之通过W3C XHTML验证，再则自定义下搜索对象。现在除了站内文章搜索后，还支持网页，新闻，图片，视频和图书搜索。在自己的博客上就可以直接搜到Youtube视频了。还蛮方便的。</p>
<p>具体调用Google ajax search的做法，Storyday的文章已经写得很明了，并提供代码下载，无需在此重复了。前提是必须到google站点申请个API。</p>
<hr/><p style="font-size:1.5em;font-weight:bold;"><a href="http://www.thinkagain.cn/archives/722.html#comments">评论5:</a></p><p><strong>5.</strong><i>2009.04.05.4:33.pm</i>.&nbsp;<a href="http://www.girlqiqi.cn">琪琪老爸</a>: 不知道google ajax search支持adsense绑定了没有.</p><p><strong>4.</strong><i>2008.06.27.9:26.am</i>.&nbsp;<a href="http://www.thinkagain.cn">山之岚</a>: To Pany: 我只是借用了别人的方法，具体代码等可以在storyday网站上下载，链接文中已有。</p><p><strong>3.</strong><i>2008.06.27.3:23.am</i>.&nbsp;<a href="http://pany.cn">Pany</a>: 把你的代码贡献一下吧
觉得你的代码比较美观!
而且功能也多..
发邮箱里即可921308@qq.com
谢拉</p><p><strong>2.</strong><i>2007.09.23.1:33.pm</i>.&nbsp;<a href="http://lxz.name">ddkk3000</a>: 好像api已经不能申请了吧
另外楼上兄弟，你只需要再添加一个分类，直接调用那个分类就好了</p><p><strong>1.</strong><i>2007.09.20.12:48.pm</i>.&nbsp;<a href="http://www.marketing-life.cn">Shaoqing</a>: 我们可以交换链接吗?我已经把你加入链接了。
另外请教一下，右边栏怎样在BLOGROLL 之外再添加一个LINKS？
我的首页上只有BLOGROLL.</p><hr/><p style="font-size:1.5em;font-weight:bold;">推荐阅读</p><p><i>2007.10.05.8:02.pm</i>.&nbsp;<a href="http://www.thinkagain.cn/archives/751.html" title="站点文章一多，无形中增大了浏览者查找自己所要内容的难度。虽说Wordpress">如何使用本站站内搜索 (7)</a></p><p><i>2009.01.03.4:57.pm</i>.&nbsp;<a href="http://www.thinkagain.cn/archives/1031.html" title="English user please navigates to http://wordpress.org/extend/plugins/wp-smilies/&#160; for instruct">Wordpress插件: WP Smilies (49)</a></p><p><i>2008.12.19.12:20.am</i>.&nbsp;<a href="http://www.thinkagain.cn/archives/1030.html" title=" 有段时间没有写些技术类的文章了，（p.s，似乎其它文章也没多写。。。">12行代码给Wordpress主题挂上AJAX (35)</a></p><p><i>2008.12.07.9:51.pm</i>.&nbsp;<a href="http://www.thinkagain.cn/archives/1029.html" title=" 这一阵子，Google Friend Connect似乎闹得挺热乎的。周围的网友博客们纷纷在">Hot friends新增支持用户自定义头像显示 (65)</a></p><p><i>2008.10.27.9:52.pm</i>.&nbsp;<a href="http://www.thinkagain.cn/archives/1024.html" title="如题。将Hot friends和mailtocommenter插件分别更新到1.3.2和1.3版。

其中hotfriends">从更新hot friends和mailtocmmenter谈起 (33)</a></p><p><i>2008.09.09.8:58.pm</i>.&nbsp;<a href="http://www.thinkagain.cn/archives/994.html" title="今天，Wordpress官方发布了2.6.2版。没有跑去Trac看代码变动地方，直接就将程">Wordpress Hacks:WP2.2版后中文邮件标题乱码解决方法 (22)</a></p><p><i>2008.08.25.11:06.pm</i>.&nbsp;<a href="http://www.thinkagain.cn/archives/989.html" title="English user please navigates to http://wordpress.org/extend/plugins/mailtocommenter/ for instructi">Wordpress插件: Mail To Commenter v1.3.2 (377)</a></p><p><i>2008.08.20.8:11.pm</i>.&nbsp;<a href="http://www.thinkagain.cn/archives/987.html" title="假设您已经阅读过上文，对于此问题背景的来龙去脉有所了解。此文将正式">Wordpress Hacks:解决晒SPAM数无法通过W3C验证&#8230;续 (11)</a></p><hr/><p>Copyright &copy; 2012&nbsp;|&nbsp;<a href="http://www.thinkagain.cn">Think Again</a>&nbsp;|&nbsp;<a href="http://www.thinkagain.cn/archives/722.html">原文链接</a></p><img src="http://img.tongji.cn.yahoo.com/710673/ystat.gif"/>]]></content:encoded>
			<wfw:commentRss>http://www.thinkagain.cn/archives/722.html/feed</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
	</channel>
</rss>

