Add Contextual Search to Your Blog

Y!Q gives your readers the ability to search for content directly related to your posts.

Say you’re reading a weblog about astronomy and you run across a post about refraction, a stellar optical illusion caused by the atmosphere. If you want to learn more about refraction, you’ll need to leave the weblog, browse to your favorite search engine, type in refraction, and start browsing through the results. Unfortunately, the search is lacking any context, and though you will get results related to astronomical refraction, you’ll also find many results about lenses, the human eye, and physics. Most likely, you were interested in the term refraction as it relates to astronomy.

Yahoo! is addressing this problem by bringing search capabilities to remote sites such as weblogs with a feature called Y!Q. Y!Q is a contextual search, which means a Y!Q search uses additional information to refine the search results. If the astronomy weblog had a Y!Q search link embedded with every post, you could have clicked the link to see the top related results without leaving the weblog—and within an astronomical context.

Weblogs are particularly suited for contextual search, because each post is a unique burst of text with its own topic. A related search link can give readers a path to explore more about a particular topic. And adding the feature to your weblog is just a matter of knowing some HTML.

Most weblog systems provide a template system for defining how posts should ...

Get Yahoo! Hacks now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.