Use Google Gears for Fast Client-Side Search

When Google’s Gears offline web application API turned one year old six weeks ago, Google announced that it had signed its biggest external user to the Gears bandwagon: MySpace. The social network didn’t use Gears to create an completely offline version of the site, but it did use the Google API to add a long sought after missing feature of its messaging application, search.

MySpace is using Gears to allow users to store their message archive offline and then search it in real-time. Data can be synced through Gears in the background and search can still feel like its happening on the web, even though searches are being conducted locally. Because everything is happening client side, you can do things like return search results in real-time while a user types — something that is harder to do when requests need to be sent over the web, especially at scale.

Gears is able to accomplish this because Full-Text Search abilities are bundled into the SQLite database that comes with the API. Google engineer Brad Neuberg this week released PubTools, an open source collection of JavaScript files that uses Gears and the Dojo Toolkit to do the type of client-side fast search that MySpace does. He also published a long article detailing how create a fast client-side search engine using Gears and embed it in a web site or web app.

Josh Catone joined Mashable in May 2009 and is Executive Director of Editorial Projects. Before joining Mashable, Josh was the Lead Writer at ReadWriteWeb, the Lead Blogger at SitePoint, and the Community Evangelist at DandyID.