Federated Search HTML to RSS Connector Sample
Note
This topic describes functionality that is part of the Infrastructure Update for Microsoft Office Servers. To download the update, see Description of the SharePoint Server 2007 infrastructure update: July 15, 2008.
By using federation in Enterprise Search in Microsoft Office SharePoint Server 2007, you can include search results from any searchable XML feed (such as RSS or Atom). Enterprise Search sends an OpenSearch query to the source feed, receives XML results in return, and displays these results in a Federated Results Web Part. To search a source that does not expose an XML feed (for example, databases and HTML pages), you must create a lightweight interface that exposes the location as an XML feed.
For HTML pages, the interface converts the HTML of the page into a structured XML feed (such as RSS or Atom). Then you create a new OpenSearch location that uses the feed exposed by your interface. You can either locate this application on another site or put it in the _layouts folder for the Enterprise Search site. For more information about how and when to create this type of application, see Architecture Guidance for Building Federated Search Connectors.
This sample shows you how to implement and deploy a federated search connector that converts HTML to an RSS feed. As an example, the article describes how to convert the HTML of Windows Live Search results into an RSS feed. This sample must be modified to work with results from any other location. Other search sites will return different HTML, which this sample will not parse correctly, and they might have special requirements for accessing their results (for example, authentication requirements). Because Windows Live Search already provides an RSS feed, this sample is educational for that location. You do not have to convert HTML into an RSS or ATOM feed to access results from Windows Live Search.
Note
Some sites might object to using their search results in this manner. You must check a site's Terms of Use, and, if necessary, check with the site's owners, to determine whether remote access in this manner is an authorized use of its services and data. If it is not authorized, you cannot use this sample or this approach to display their results.
For the download, which includes the complete code for the Federated Search HTML to RSS Connector sample application, see HTML to RSS Federated Search Connector.
Prerequisites
To use the Federated Search HTML to RSS Connector sample, your environment must have the following installed:
Office SharePoint Server 2007
Infrastructure Update for Microsoft Office Servers
Microsoft Visual Studio 2005 or Microsoft Visual Studio 2008 with Microsoft Visual C# enabled
Completing the walkthrough
The following topics walk you through creating and deploying a federated search HTML to RSS connector:
Step 1: Set Up the Project for the Federated Search HTML to RSS Converter
Step 2: Add the Code for the Federated Search HTML to RSS Converter
Step 3: Create the Federated Search Location and Customize the XSL
See Also
Concepts
Architecture Guidance for Building Federated Search Connectors
Federated Results Web Parts XSLT