我假设你已经在你的谷歌CSE搜索引擎配置上启用了“自动完成”。
下一步是添加
Url
元素
type
中的“application/x-suggestions+json”
OpenSearchDescription
元素。我仔细研究了一下,下面的URL似乎可以工作(一定要在上面输入自己的partnerid
[YOUR PARTNER ID]
:
http://www.google.com/complete/search?q={searchTerms}&partnerid=`[YOUR PARTNER ID]`&ds=cse&output=firefox
例如。,
<OpenSearchDescription xmlns="http://a9.com/-/spec/opensearch/1.1/" xmlns:moz="http://www.mozilla.org/2006/browser/search/">
...
<Url type="application/x-suggestions+json" method="get" template="http://www.google.com/complete/search?q={searchTerms}&partnerid=#YOURPARTNERID#&ds=cse&output=firefox"></Url>
</OpenSearchDescription>
这里是
a little webapp
我创建了(预先填充了一些有用的值)来帮助您使用OSDD。