English 中文(简体)
Google Custom Search and Opensearch
原标题:

I have a Google Custom Search Engine on our site and I have recently implemented the opensearch XML file so that I can add our site s search in the browsers search box.

Any idea how I can add the autocomplete / suggestion feature to the browsers search box?

最佳回答

I m assuming you ve already enabled "autocompletions" on your Google CSE search engine configuration.

The next step is to add a Url element with the type "application/x-suggestions+json" in the OpenSearchDescription element. I looked into this a little, and the following URL seems like it should work (be sure to enter your own partnerid where it says [YOUR PARTNER ID]:

http://www.google.com/complete/search?q={searchTerms}&partnerid=`[YOUR PARTNER ID]`&ds=cse&output=firefox

e.g.,

<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}&amp;partnerid=#YOURPARTNERID#&amp;ds=cse&output=firefox"></Url>
</OpenSearchDescription>

Here s a little webapp I created (pre-populated with some helpful values) to help you with your OSDD.

问题回答

暂无回答




相关问题
Autocomplete in opensearch

I have done autocomplete functionality for opensearch using WCF. But we are using 3.5, so I now need to achieve the same without using WCF. Any idea or please send me any useful link. My scenario is ...

Google Custom Search and Opensearch

I have a Google Custom Search Engine on our site and I have recently implemented the opensearch XML file so that I can add our site s search in the browsers search box. Any idea how I can add the ...

Confused about namespaces in Atom feed

Is there any difference between <opensearch:totalResults>1000</opensearch:totalResults> and <totalResults xmlns="opensearch">1000</totalResults> I m using the ...

Track custom firefox search engine with google analytics

I made a custom Firefox search engine. It used the code below. Is it possible for me to track the use of this on the site. My concern is that searches form the firefox search engine will look like ...

OpenSearch .net (C#) library: which one?

i would like to add OpenSearch to my C# webapplication. does someone recommend a certain .net library? or does a custom webapplication require a tailormade opensearch implementation?

热门标签