Building an OpenSearch Application


Within two days of launching OpenSearch, an open standard for syndicating search results, there have already been dozens of OpenSearch engines developed and published on A9.com. The OpenSearch coverage in the blogsphere has been amazing, and leading edge of technology adopters are embracing and innovating on top of the idea faster than I can keep up. Tatsuhiko Miyagawa even wrote a WWW::OpenSearch Perl module and posted it on CPAN already.

Lest I find myself left entirely behind in the OpenSearch world (I'm kidding, that would be great!), I managed to put together a little application that perhaps people may be interested in.

The AWS OpenSearch on unto.net application uses Amazon Web Services to retrieve product data and provide a very light-weight (and powerful, as you'll see in a moment) search engine, all available to anyone via OpenSearch APIs.

And while I am an A9/Amazon employee, (and, to be fair, the author of the OpenSearch specifications), nothing done here required any inside or proprietary knowledge about either OpenSearch or AWS. The idea behind both projects is to allow anyone, anywhere, enough access to those technologies that they can build world-class applications.

The application works by taking the user's search terms and making a HTTP REST call to AWS. Also passed into AWS is the location of an XSLT stylesheet, which transform standard AWS XML into OpenSearch RSS. No processing is required on the unto.net side -- AWS is able to handle the entire transformation, based on the stylesheet alone.

As a user, you can choose to view your AWS data as "OpenSearch". For example, here's a search for "Neal Stephenson", with the output returned in OpenSearch RSS 1.0 format.

You can also choose to view those results as HTML (a cleaner, and more minimal version than on the Amazon website, if that's the type of thing you like). Here's Neal Stephenson again, this time as HTML. The HTML is rendered by translating the OpenSearch RSS results via a different XSLT stylesheet. (I could have gone directly from AWS to HTML via a stylesheet, but I wanted to demonstrate the OpenSearch to HTML translation.)

But here's the amazing part -- since OpenSearch RSS is RSS, you can take the OpenSearch RSS output and use it with any RSS tool, such as a blog reader. And since most blog readers are very good at disambiguating between duplicate entries, you can subscribe to your search, and only be notified when the result set changes.

So you could save your search for "Neal Stephenson" as an RSS feed and you will only see new items when the search results change. In fact, here's a link to subscribe to a search for "Neal Stephenson" on Bloglines (or My Yahoo!). With this, you could see immediately -- using your existing blogreader -- when your favorite author publishes a new book, or when your favorite band (this week) releases a new album, or when the price of compact flash drops, or when a new lens for your digital SLR is introduced.

(And if you want, the link to the OpenSearch Description Document is available for each search category as well -- here's the OSD for Electronics. )

The AWS OpenSearch engine on unto.net was just a way for me to begin to get my head around the possibilities. Right now, I'm happy to keep it up and running, and will likely publish all of the source code and stylesheets in order to help other people get started. If someone else comes along with a better OpenSearch product search, that is great -- that's the whole idea behind OpenSearch after all. In the meantime, enjoy, and I'd love to hear your feedback.