Surftrackr now has search

Feb 12th 2008

I added a search feature, in addition to the lexicons and hilites features. It's ridiculously easy with Django, and allows the Surftrackr user to put in words to search for in URLs (including the website name and the path to the resource).

If you want to make the search a bit quicker, you can add indexes to the relevant database table using the MySQL console:

mysql surftrackr -u surftrackr -p
create index url_index on log_weblog (url);
create index datetime_index on log_weblog (log_datetime);

Then just visit the /search/ location (clickable link added to top left of the main Surftrackr screen) and enter any search terms you're interested in.

Search results are shown using "sensible" URLs, eg /search/warez/ if you searched for "warez", rather than something arcane like /search.pl?t=warez. This is only marginally relevant for every-day use, but can be very handy if you need to email a search result to someone. Just cut-and-paste the URL into the email, and chances are it won't be molested by your mail program because it doesn't contain any "special" or unusual characters which might be escaped when the email is sent.

Another advantage is you can just drop straight in on the search URL if you're in a hurry. Just enter http://example.com/search/word/, where word is the search-term you're interested in, and example.com is your Surftrackr website, and you should be taken straight to the results page, without needing to go through the search form first.

Note that it's preferable to use lexicons if you find yourself bashing in the same search-terms over and over again. They give you quick, one-click access to a list of words, grouped according to your requirements. More details (maybe even a user-guide) to follow.

Simon Burns
12 Feb 2008