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.

Dion Almaer over at Ajaxian interviewed Neuberg about the project. The video is below.

Let us know if you have used Gears at all in any of your projects, and if so, how.

Free book: Jump Start HTML5 Basics

Grab a free copy of one our latest ebooks! Packed with hints and tips on HTML5's most powerful new features.

  • http://www.tyssendesign.com.au Tyssen

    WordPress 2.6, released this week, makes use of Gears.

  • Thomas

    To be honest, the first time ever i used gears is the new WordPress 2.6 “turbo”. I promise, i will take a look at what they are doing there over the weekend ;-)

    Thomas

  • Brad Neuberg

    Hi Thomas and Tyssen, if you have any questions while playing with Gears feel free to contact me (brad @@@ neuberg @@@ ATAT google.com (remove the @@@s and the ATAT).

    Best,
    Brad Neuberg
    http://codinginparadise.org