Searchy Fun

I've just added a search feature to my diary, at radiac.net/search. You can stick something after that to search the diary for something, ie /search/foo. The GET form has to submit to /search/?s=foo - I'm not loving that little difference, but that's just the price of a GET, isn't it.

I don't really expect anyone to use it, but it should save me a lot of time when I want to link to an old entry. I was going to put up a 'recently searched' list, but then I remembered I'm friends with Tristan, and decided it might not be the best idea.

You stay classy.

Comments

You using the fulltext catalog feature of MySQL? Or some other clever way of doing it?

Besides, I've been trying to get highlighting working on returned results sets on a project I'm working on, and it's proving a little problematic at the moment. Maybe that's because I've got weird tags like [b] and suchlike in the text, and so weeding them out and wibbling around punctuation means it's a feature that gets dropped. Oh well.

I decided not to use fulltext. Notnet's running an archaic version of mysql, so I couldn't get the advantage of a fulltext binary search, and speed and scaleability aren't issues here. This is also just a quick ~10 line hack that will get replaced in a couple of months time anyway, so I didn't think it was worth logging in and modifying my table :p So I just went with a little pattern match.

Leave a comment