Creating a Client-Side Search Engine With Gears




I've posted an in-depth article and tutorial on creating a client-side search engine with Gears. Here's a short snippet from the article:

Did you know that you can use Gears to do fast, client-side searching of data, similar to a client-side search engine? Gears bundles Full-Text Search (FTS) abilities right into its local, SQLite database. MySpace, for example, uses this feature with their MySpace Mail application, downloading all of a user's messages for fast, client-side search. Because all of the data is local, you can do nifty things like search over the data in real-time as the user types, something that is much harder if you have to query over the network to a server to do the searching.

Would you like to add the same kind of fast, local searching to your own web page and web applications? This article introduces you to PubTools Search and the Gears features that power it, namely Full-Text Search and Workers. PubTools Search is an open source JavaScript library that drops a client-side search engine right into your page. You configure it with basic HTML plus a list of URLs to index. Once loaded, a search form that uses the local Gears full-text search abilities will appear in your page to quickly and locally search over the documents in real time as a user types into the search field.

Please note that PubTools Search is not an official Google project or Gears API; it is a project I created on my own to teach and help developers. The Gears team does not support this project.

The article covers the following:

  • An introduction to Gears' Full-Text Search and Worker features
  • How to drop PubTools Search into your page to quickly get going
  • Deep walkthrough and dissection of how PubTools Search works internally with source code and snippets so you can use these Gears features in your own applications
  • An introduction to parts of the Dojo toolkit used in PubTools Search, using actual source from PubTools Search including a discussion on some of the techniques used in modern JavaScript development
  • Tips and tricks when working with Gears

Read the full article and try the demo yourself!