Getting Started with Federated Search in Windows

Windows 7 support for search federation to remote data stores using OpenSearch technologies enables users to access and interact with their remote data from within Windows Explorer. You can build a web-based data store that can be searched using Windows federated search and enable rich integration of your remote data sources with Windows Explorer without having to write or deploy any Windows client-side code.

This topic is organized as follows:

Windows 7 supports the connection of external sources to the Windows client through the OpenSearch protocol. This enables users to search a remote data store and view results from within Windows Explorer. The OpenSearch v1.1 standard defines simple file formats that can be used to describe how a client should query the web service for the data store and how the service should return results to be rendered by the client. Windows federated search connects to web services that receive OpenSearch queries, and returns results in either the RSS or Atom XML format.

The following screen shot illustrates the search results obtained after remotely searching a SharePoint site.

screen shot that shows search results from a sharepoint site as displayed in windows explorer

To build federated search, perform the following steps:

  1. Enable your data store to be searched from Windows Explorer by providing an OpenSearch-compatible web service that can return results in RSS or Atom format.
  2. Create an OpenSearch Description (.osdx) file that describes how to connect to the web service and how to map any custom elements in your RSS or Atom XML.
  3. Deploy the search connectors to Windows client computers with an .osdx file.

The following diagram illustrates the steps for building federated search.

diagram of the process for building federated search

How Federated Search Works

Communication between Windows Explorer and your OpenSearch web service is performed through the Windows Data Layer. The Windows Data Layer can communicate with different types of data stores through Windows Store Providers. Each provider specializes in communicating with data stores that support a particular protocol and have specific capabilities. For example, the following illustration sows how the OpenSearch provider communicates with data stores that provide a web service that supports the OpenSearch standard.

diagram showing communication from windows explorer on the client through the opensearch data store on the remote server

To enable your data store to support federated search in Windows 7, you must perform a number of tasks. The following table lists tasks for enabling your data store, what is required to accomplish each task, and where to find documentation.

Task Requirement Documentation
Enable your data store to be searched by Windows Explorer.
Build an OpenSearch-compatible web service.
Create an OpenSearch Description (.osdx) file.
Connecting Your web Service in Windows Federated Search
Enabling Your Data Store in Windows Federated Search
Actively deploy your web service to users within an enterprise.
Supply an .osdx file to your users, copy it locally, and make it accessible to the user via a shortcut.
Deploying Search Connectors in Windows Federated Search
Enumerate search results in Windows Explorer in response to a query.
Implement a web service that accepts a query string and returns results in RSS or Atom format.
Connecting Your web Service in Windows Federated Search
Enable users to add your data store to their Windows Explorer.
Create an .osdx file and supply it to your users.
Enabling Your Data Store in Windows Federated Search
Display your items as file-like items in Windows Explorer.
Return a URL to the file or content stream by using enclosure or media:content elements
Supply a file name extension or a MIME type that the client computer recognizes.
Enabling Your Data Store in Windows Federated Search
Display custom properties in Windows Explorer, beyond those defined in RSS or Atom standards.
Provide additional metadata by using another XML namespace in your RSS/Atom output.
Add a property map to your .osdx file.
Creating an OpenSearch Description File in Windows Federated Search
Customize the properties that are displayed for your items in Windows Explorer.
Add proplist mappings to your .osdx file.
Creating an OpenSearch Description File in Windows Federated Search
Display a custom webpage view of your items in the preview pane.
Return distinct link and enclosure values.
Map a URL value to the System.WebPreviewUrl Windows Shell property.
Creating an OpenSearch Description File in Windows Federated Search
Display a command bar button in Windows Explorer that rolls the query over to your website.
Provide a Url format="text/html" template in the .osdx file.
Creating an OpenSearch Description File in Windows Federated Search

 

Sending Queries and Returning Search Results in RSS or Atom

When the user types a term into the search box in the upper-right corner of Windows Explorer, the query is sent to the OpenSearch provider, which then sends the query to the remote data store. The remote web service responds to the query by providing results in an XML document, typically referred to as a feed, in one of two supported formats (RSS or Atom). Each result item in the feed includes XML child elements to represent or describe item metadata, such as the title, URL, description, thumbnail image, and so forth. The OpenSearch provider is responsible for mapping the XML element values to Windows Shell system properties that can be used by Windows applications.

Federated Search Examples

The following example OpenSearch Description (.osdx) file consists of ShortName and Url elements, which are the minimum required child elements to connect an external data store to the Windows client through the OpenSearch protocol.

<OpenSearchDescription xmlns="https://a9.com/-/spec/opensearch/1.1/">
        <ShortName>My web Service</ShortName>
        <Url format="application/rss+xml" template="https://example.com/rss.php?query={searchTerms}&amp;start={startIndex}&amp;cnt={count}" />
        </OpenSearchDescription>

The following example illustrates how to make a web-enabled data store searchable in RSS format, and how to specify that one search item be returned:

<rss version="2.0" xmlns:media="https://search.yahoo.com/mrss/" xmlns:example="https://example.com/namespace">
   <channel>
      <title>Search Results</title>
      <item>
         <title>An example result</title>
         <link>https://example.com/pictures.aspx?id=01</link>
         <description>This is a test of the emergency search results system. If this were a real emergency result, then you would be reading something more useful.</description>
         <pubDate>Wed, 1 Oct 2008 23:12:00 GMT</pubDate>
         <media:content url="https://example.com/pictures/picture01.jpg" fileSize="212889" type="image/jpeg" height="768" width="1024"/>
         <media:thumbnail url="https://example.com/thumbnails/picture01.jpg" height="120" width="160"/>
         <example:dateTaken>Mon, 22 Sep 2008 23:12:00 GMT</example:dateTaken>
      </item>
   </channel>
</rss>

The following example illustrates how to map properties to default system properties so that displayed items are sorted and grouped:

<author>Sanjay Jacobs</author>
                <category>Nature</category>
                <pubDate>Thu, 24 Apr 2008 2003 21:34:38 GTMT</pubDate>

The following example illustrates how to adds a thumbnail image display to each item in Windows Explorer:

<media:thumbnail>    

Additional Resources

For additional information about implementing search federation to remote data stores using OpenSearch technologies in Windows 7 and later, see "Additional Resources" at Federated Search in Windows.

Federated Search in Windows

Connecting Your web Service in Windows Federated Search

Enabling Your Data Store in Windows Federated Search

Creating an OpenSearch Description File in Windows Federated Search

Following Best Practices in Windows Federated Search

Deploying Search Connectors in Windows Federated Search