다음을 통해 공유


Federated Search in Windows

[This documentation is preliminary and is subject to change.]

Describes Windows 7 support for search federation to remote data stores using OpenSearch technologies that enable users to access and interact with their remote data from within Microsoft Windows Explorer.

Following the best practices described here 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 contains the following sections:

  • What is Federated Search?
  • How Federated Search Works
  • Steps for Building Federated Search
  • Best Practices
  • Additional Resources
  • Related Topics

Windows 7 supports the connection of external sources to the Windows Client through the OpenSearch World Wide Web link 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 receives OpenSearch queries, and returns results in either the RSS or Atom XML format.

Searching a Sharepoint site from Windows Explorer

How Federated Search Works

Communication between Windows Explorer and your OpenSearch Web service is performed at the Windows Data Layer. Through Windows Store Providers the Windows Data Layer can communicate with different types of data stores. Each provider specializes in communicating with data stores that support a particular protocol and have specific capabilities. The OpenSearch provider communicates with data stores accompanied by a Web service that supports the OpenSearch standard.

Task Requirement See

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

Enumerate search results in Windows Explorer in response to a query

Implement a Web service that accepts a query string, and returns RSS or Atom formatted results

Connecting Your Web Service in Windows Federated Search

Allow 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 using enclosure or media:content elements

Supply a file extension or a MIME type that the client machine recognizes

Enabling Your Data Store in Windows Federated Search

Display custom properties in Windows Explorer, beyond what is defined in RSS or Atom standards

Provide additional metadata 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 Web page 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 Web site

Provide a Url format="text/html" template in the .osdx file

Creating an OpenSearch Description File in Windows Federated Search

Supply an .osdx file to your users

Copy the .osdx file locally, and expose it to the user via a shortcut

Deploying Search Connectors in Windows Federated Search

To build federated search, perform the following steps:

  • Connect a Web service between your data store and Windows federated search.
  • Enable the data store to be searched from Windows Explorer via OpenSearch with RSS or Atom output.
  • 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.
  • Deploy the search connectors to Windows client machines with an .osdx file.

Overview

Best Practices

Tips and best practices for working with OpenSearch in Windows 7 are as follows:

  • Support the {startIndex} and {count} parameters, and be sure to always return the number of items requested unless you are returning the last of the results.
  • If you know the file extension, map it to the System.FileExtension Windows Shell property. Using file extensions is a better way to identify a file type than MIME type.
  • Ensure that the MIME type or file extension you specify in the RSS matches the filename and MIME type returned in the HTTP header by the Web server that hosts the item when the item content is requested.
  • If you are returning file items, return a file size whenever possible. This ensures that the download progress dialog is accurate.
  • Verify that requests for items beyond the end of the results set return no results. Note  Do note repeat results.
  • Do not put HTML tags where they don't belong. Per the RSS specification, they are valid in the description field, but not in the title field.
  • Do not create enclosures for Web page items. For example, if you create an enclosure and map a file extension of .aspx, then undesired functionality would result. The file would be downloaded by Windows Explorer to the internet cache and executed from there. In the case of a .aspx file, Web browsers do not handle this file type. The user would get an Open With dialog, or the file may be opened by an application like Visual Studio. Avoid this by only returning a link element for Web pages.
  • Provide a Web roll-over URL in the .osdx file using a URL template with format="text\html".
  • Provide a URL to the parent folder, container, or Web page by mapping a custom element URL value to the System.ItemFolderPathDisplay Windows Shell property.

Additional Resources

  • For a demonstration of how to create an OpenSearch Web service for a SQL database, see the Windows 7: Empower Users to Find, Visualize and Organize their Data with Libraries and the Explorer World Wide Web link video presentation given at PDC (October 2008).
  • For information on Windows system-defined properties, see System-Defined Properties for Custom File Formats.
  • For information on Shell system properties, see System Properties.
  • SharePoint Search Server 2008 and MOSS 2007 SP2 also support federated search of remote servers using OpenSearch. For more information about federated search and Search Server 2008 deployment with Office SharePoint Server 2007, see Welcome to Microsoft Search Server 2008.
  • See the Microsoft Download Center Web site for the following downloadable resources:
    • Windows 7 Federated Search Provider Implementer's Guide
    • Search Server 2008 Sample: Federated Search Connector Sample
  • For more information about the OpenSearch standard, see the OpenSearch Web site.