13.5. Advertising OpenSearch Capability

OpenSearch is a standard for describing how to submit queries to a search engine and how the search results are returned. SharePoint can be configured to provide search results to a client that understands the OpenSearch schema file.

For more information on OpenSearch, see www.opensearch.org.

13.5.1. Telling the Browser Where to Search

Internet Explorer and Firefox provide in-browser search capability by routing the query to a search provider. These browsers detect sites that can participate as search providers by reading a tag in the page that indicates the site supports the OpenSearch standard. When a user browses to sites that support this standard for search, Internet Explorer advertises that search is available by turning the browser search button orange.

The OpenSearch standard defines a schema for an XML file that describes how to submit search queries to a site. The basic format of the file is as follows:

<?xml version="1.0" encoding="UTF-8"?>
<OpenSearchDescription xmlns="http://a9.com/-/spec/opensearch/1.1/">
  <ShortName>Short name</ShortName>
  <Description>Description</Description>
  <Url type="text/html" template="http://url?k={searchTerms}"/>
  <SyndicationRight>open</SyndicationRight>
</OpenSearchDescription>

Listing 13-8 contains the XML that would use a SharePoint Search Center site.

Example 13-8. OpenSearch markup for a SharePoint Search Center site
<?xml version="1.0" encoding="UTF-8"?> <OpenSearchDescription xmlns="http://a9.com/-/spec/opensearch/1.1/"> ...

Get Professional SharePoint® 2007 Web Content Management Development: Building Publishing Sites with Office SharePoint Server 2007 now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.