Geeks With Blogs

Lance's TextBox

I used the RSSBus WebPart to create a multi-source search in SharePoint – this will let me enter one search term, and see results from a variety of different search services at the same time.  The RSSBus WebPart template turned out to be extremely simple, thanks to its built-in feed manipulation capabilities.

<div id="search">
<label for="search"><b>Search:</b></label>
<input id="search" type="text" name="search" size="25" value="[[_request.form:search| def('')]]" />
<input type=submit value="Search" />

<rsb:check attr="_request.form:search">
<rsb:set item="input" attr="feed#1" value="[[_request.form:search]]&format=rss&FORM=ZZRE" />
<rsb:set item="input" attr="feed#2" value="[[_request.form:search]]" />
<rsb:set item="input" attr="feed#3" value="[[_request.form:search]]&format=rss_200" />
<rsb:set item="input" attr="feed#4" value="[[_request.form:search]]&ie=UTF-8&output=rss" />
<rsb:set item="input" attr="feed#5" value="[[_request.form:search]]" />

<rsb:call op="feedUnion" in="input">
<a href="[[rss:link]]">[[rss:title]]</a><br />
<div>[[rss:description]]</div><p />
hr />

The first 5 lines are just HTML to create a search query text box and submit button.  I don’t use a form tag, I just piggy back on the existing form that is in every SharePoint page.  Next, I check to see if the search input variable exists in the form of the incoming HTTP request.  If so, I set my source feeds, call for the union of the feeds (duplicates are automatically discarded), and output some html for each result!

Technorati Tags: , ,
Posted on Monday, May 18, 2009 2:12 PM | Back to top

Comments on this post: Multi-Source Search in SharePoint

No comments posted yet.
Your comment:
 (will show your gravatar)

Copyright © Lance Robinson | Powered by: