A Tech Blog

AJAX.Search WordPress Plugin

I use the Spotlight feature in OS X an awful lot. While some people would rather use things like Quicksilver, I like just hitting command+space and typing in what Im looking for, be it a document or even an application I want to open.

Thats the inspiration for AJAX.search, a search system built on Prototypes AJAX framework. It will make a call to a URL you specify and display the results under your search box like Spotlight (and now, like the search at Apple.com). From there you can hit the up or down arrow keys to select a result and then hit the enter key to visit the link.

I also built a WordPress plugin that uses AJAX.search in the default search box, and in fact you can test it out on this sites search box right now. By default the plugin will search all your posts and display them in the results grouped by category.

If you want to try it out on your WordPress install, you can download the plugin here. There are still features I still want to implement, and it may not work on all WordPress versions (I’ve only tested on version 2.2.1). Eventually there will be a configuration page in the admin to allow you to change a few settings, such as number of results to display and whether to show categories in the results.

Download the AJAX.search WordPress Plugin version 0.1

If you’re using K2: make sure you turn off Advanced Navigation in the K2 options, since K2 has an AJAX search function that will collide with this one. If you want to keep Advanced Navigation on, you’ll have to comment out the Javascript in the K2 header file that sets up the K2 AJAX search.