Prabir's Blog

where the tech matters...

Create a Windows 7 Federated Search Connector for your Blog

December 20
by prabir 20. December 2009 08:28

The driving force that landed me to create this blog that you are reading now, has mainly been that I wanted to contribute back to the society, “the internet society” from where I have learned so much. And the other one was to also put as a reference from the future. There are many times when I actually need to refer to my own blog.

For instance, I often need to redirect HTTP to HTTPS. (You can find this article at http://blog.prabir.me/post/HTTP-redirection-to-HTTPS.aspx). But opening blog.prabir.me and then typing redirect in the search box would quite lose my time. So I landed up creating a Windows 7 Federated Search Connector – a cool new Windows 7 feature.

When I search for redirect keyword in my blog using the Window 7 connector I would get the following result.

image

 

How does the magic happen. Well first the search results show up as RSS feeds using the open search URL conventions. And luckily BlogEngine.NET already supports it out of the box. Try this url http://blog.prabir.me/syndication.axd?q=redirect

It already contains the page called syndication.axd where we can pass you search query using the q querystring.

To do that we define a Windows 7 Search Connector file ending with .osdx extension. It is a normal text file. So you can edit it using your favorite text editor.

<?xml version="1.0" encoding="UTF-8"?>
<OpenSearchDescription xmlns="http://a9.com/-/spec/opensearch/1.1/">
  <ShortName>Prabir's Blog - www.prabir.me</ShortName>
  <Description>Prabir's Blog - where the tech matters</Description>
  <Language></Language>
  <Url type="application/rss+xml" template="http://blog.prabir.me/syndication.axd?q={searchTerms}"/>
</OpenSearchDescription>

Notice the URL, we pass the search query in querystring q as {searchTerms}, that is how Windows 7 uses it.

Once you save it to .osdx file, double click it and you will asked if you want to add it. Click add then you are all set.

But the fun doesn’t end here. In the search results when you double click, it will open the article in Web Browser. And if you have the preview pane, it will show up in the Window Explorer Search Window it self as shown below.

image

prabirDOTme-Windows7FederatedSearchConnector.zip (371.00 bytes) [Downloads: 100]


Share/Save/Bookmark Subscribe

Tags: ,

Blog | BlogEngine.NET | snippets | Windows

Comments

12/20/2009 8:31:41 AM #

trackback

Create a Windows 7 Federated Search Connector for your Blog

You've been kicked (a good thing) - Trackback from DotNetKicks.com

DotNetKicks.com

12/22/2009 2:38:01 PM #

Nipul Parikh

I like to work on blog.

Nipul Parikh India

12/22/2009 7:04:40 PM #

Sinopsis Film

i really appreciate this your good article ..  from there i get something that i want to know .. thanks for this usefull informations

Sinopsis Film United States

blog comments powered by Disqus