bubble的备忘录

本blog主要用于常用资料的备忘、备份、备搜索

阅读笔记 Google Example Code:Site Restricted Search

地址:http://www.google.com/uds/samples/apidocs/sitesearch.html
This sample demonstrates how to use the setSiteRestriction() method of the GwebSearch, GblogSearch, and GnewsSearch objects. When doing site restricted search, it is often a good idea to specify a customized label for the search result section header, and in some cases, perform some custom styling of the search results. Both of these functions are supported by using the setUserDefinedLabel() and setUserDefinedClassSuffix() methods.

结论:本例子在搜索中执行了限定站点搜索,并调用了定制的个性化搜索引擎,可以用这种方式在我们的搜索引擎中先搜索我们自己的站点,在通过调用我们定制的个性化搜索引擎实现我们想要的搜索功能。

存疑:为了什么每个搜索控件的结果都默认只返回一个搜索结果?虽然在搜索结果框中,每个搜索控件都对应了一个搜索结果框,并提供了选择按键,可以选择显示一个结果,多个结果和所有结果,但为什么默认只显示了一个结果?

可用注释:
google.load('search', '1');
//google.load(moduleName, moduleVersion, optionalSettings)该方法可以加载各个 AJAX API
//moduleName 是 API 的名称(例如 "maps" 或 "search")
//version 可以指定 API 模块的版本
//optionalSettings 可以为您作为 JavaScript 对象常量加载的 API 指定所有可选配置选项
Google AJAX Search API 可用参数
name: search
versions: 1
load request: google.load("search", "1");
supported options: callback, language, nocss
# callback: The function to call once the script has loaded. 后退控件
# language: The language in which to localize the API or API's UI controls. This is specified as a ISO639 language code. 语言设置
# nocss: A boolean that tells the API whether to load any style sheets typically associated with its controls. A developer might set this to false if he was completely overriding all of the loaded CSS and wanted to avoid the unnecessary load. 呈现样式
Eg.:google.load("maps", "2", {"language" : "ja_JP"});
Eg.:google.load("feeds", "1", {"nocss" : true});

0 评论: