Geeks With Blogs

News

qrcode

Lance Robinson

Create Your Badge

Lance Robinson is a software engineer in Durham, Chapel Hill, Raleigh, and surrounding areas. More about Lance.

 Subscribe


Lance's TextBox » About Me » My Resume »Twitter

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" />
</div>

<rsb:check attr="_request.form:search">
<rsb:set item="input" attr="feed#1" value="http://search.msn.com/results.aspx?q=[[_request.form:search]]&format=rss&FORM=ZZRE" />
<rsb:set item="input" attr="feed#2" value="http://news.search.yahoo.com/news/rss?ei=UTF-8&p=[[_request.form:search]]" />
<rsb:set item="input" attr="feed#3" value="http://www.flickr.com/services/feeds/photos_public.gne?tags=[[_request.form:search]]&format=rss_200" />
<rsb:set item="input" attr="feed#4" value="http://news.google.com/news?hl=en&q=[[_request.form:search]]&ie=UTF-8&output=rss" />
<rsb:set item="input" attr="feed#5" value="http://search.twitter.com/search.rss?q=[[_request.form:search]]" />

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

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: GeeksWithBlogs.net