I realized that not having an AJAX-based live search feature for the
blog entries on this site was annoying me every time I tried to find
something, so I decided I'd better do something about that. Of course
in order to do live searching, you have to be able to perform searches
very quickly, because you're performing a whole new search with every
keystroke (more or less), so I had to set up a metadata cache and a
keyword index, which took me about a day to get working.
So a side effect of wanting to add a better search feature is that
everything that references blogs is now much faster.
The performance problem wasn't particularly noticeable when I only had
a few blog entries, but there are over a hundred now, and to display
the most recent three on the home page, it was reading every single one
into memory in order to use the last three in the list. Now it uses
the metadata cache to figure out which three to display, and just loads
those three. The speed improvement applies to everything that links to
blog entries anywhere on the site.
The advanced search options for blog entries are gone; you no longer
get the option of doing case-sensitive searches, for example. Since
I never used these options myself, I'm assuming nobody will miss them.
Note that punctuation and other special characters are omitted from
searches: you can include them in your queries, but for example the word
“don't” can also be found by searching for “dont” or
“don#%$t”. This behavior is unchanged (although I may have
fixed a bug involving newlines).
Live searching currently only works in Safari; I haven't hacked in
support for other browsers yet. Other than that, let me know if something
doesn't work the way you expect.
|