All in the <head>

– Ponderings & code by Drew McLellan –

– Live from The Internets since 2003 –

About

Search me

12 November 2003

The search facility on this site is absolutely pants. Complete rubbish. About as useful as a one legged man in an arse kicking contest. Try searching on topics I frequently discuss:

  • OS X - 0 articles
  • XML - 0 articles
  • PHP - 0 articles
  • crap – 5 articles!

So either the search isn’t working properly, or my site is full of crap. Hmm. It could be that it ignores words of less than four characters, but that’s next to useless for the stuff I discuss here, so I’m going to get the drains up on the Textpattern search tool and find out what’s going on. I should really add a submit button too. I’ve no idea why it doesn’t have one.

If all that fails, I guess I’ll just rewire the form to point to Google. Check out how it does with OS X, XML, and crap (see, there’s more crap on my site than you thought!).

Update: I’ve added a submit button. Looks like Textpattern uses MySQL full-text searching, which by default is limited to words 4 characters or more. Drat it. My posts are categorised internally, but rather generally. Maybe I need to recategorise them more specifically and enable viewing by category rather than relying on search.

- Drew McLellan

Comments

  1. § tomjleeds: Heh...your site certainly is full of crap if Google’s anything to go by! :)
  2. § Dunstan: Hey Drew - if you’re using MySQL’s fulltext search then it probably is config’d to ignore anything less than four characters - that seems to be the default. I know you can recompile (is that the word I want?) MySQL and change that figure to anything you want, so that might be an option.

    Personally I prefer to use a site specific search engine than Google, I always think it’s nice to stay ’in’ a site when I search it.

    It also means you don’t have to wait for Google to visit with its little notepad and write down everything you’ve said, so there’s no lag on new posts being indexed.

    Either way, good luck with it :o)
  3. § Martin: Just as Dunstan put it - it seems the thing is MySQL’s fulltext indexing, although changing it to less than four characters would decrease performance dramatically - with all these small words indexed it is almost the same as just doubling a column in the table, thus, searching would be almost the same as in the regular column but the table would use up to wice the space.
  4. § Mike: Why don’t you just bit the bullet and install some decent blogging software instead of flogging a dead horse?

    [Start the flames. ”My blogging software’s better than yours”]
  5. § Drew: Dunstan - yes, I can verify that it’s using MySQL’s full-text search, and yes, it appears to be defaulting to 4 chars. I’m on shared hosting (good shared hosting), so I’m not in a position to recompile MySQL.

    Can anyone think of any whacky hacks I could use to pad out a search on a TLA?
  6. § Drew: Mike - shut yer trap.

    I don’t like the idea of MT because:

    1) it’s written in Perl. Perl and I broke up several years ago, and I have no immediate plans to get back together. The whole releationship was painful start to finish, although I did, and in a way still do, love her dearly.

    2) it generates static pages. Sod that.
  7. § Jesse: Perl is about as nice as any other language.. unless some idiotic sys admin decides to mess with xheir and break perl on a ton of production and test servers only to not fix it for two weeks!

    Glad Perl and I don’t really get along all that well either.

    But MT and I.. well if it wasn’t for the static pages some sites would have had some serious downtime.
  8. § Morgan Roderick: Instead of hacking your content to allow your search engine to index TLA’s, why not just use a search engine, that allows you to control the indexer?

    mnoGoSearch comes to mind.

    Unless, your shared hosting does not allow you to install anything.
  9. § Drew: I have this mad idea that some day Dean might finish writing Textpattern and things like this could be addressed in are more permanent way.

    I’m reluctant to invest too much time until the platform is at a release level so the work can be shared.
  10. § Mike: Drew - no ;]

    1) You don’t have to touch the perl part of MT unless you want to write your own plug-ins. [even then you just drop big hints and someone else will write it]

    2) No it doesn’t. It generates static files. I’ve used it to generate PHP files before. It works very nicely actually and allows you to minimise db roundtrips to only very quickly changing content.

    Come on. You know you want to...
  11. § Dunstan: Hey drew, have you thought of writing your own simple search engine?

    It’s very easy to put together one that searches a MySQL DB and doesn’t use Fulltext.

    The only problems I can find are:

    [1] You don’t get your results ordered by rank, unless you want to write some extra php stuff to search and count the results before displaying them. And,

    [2] Searching for ’cat’ will return ’catastophe’, and ’muscat’ (I think I made that last word up) and so on.

    If you wanna hand I can let you know what I know :o)

    Take a look at my search thing if you want. Here’s an example search:

    http://www.1976design.com/blog/search/foundout
  12. § Andy:

    I'm reluctant to invest too much time until the platform is at a release level so the work can be shared.

    Hey Drew, I know exactly what you're saying about txp... I really dig it, but I wish it was more permanent so that I could modify things, without just adding in quick hacks.
  13. § Dunstan:

    “Hey drew, have you thought of writing your own simple search engine? ”
    “If you wanna hand I can let you know what I know”

    Wow, I was so clever! ;o)

Photographs

Work With Me

edgeofmyseat.com logo

At edgeofmyseat.com we build custom content management systems, ecommerce solutions and develop web apps.

Recent Links

Affiliation

  • Web Standards Project
  • Britpack
  • 24 ways

About Drew McLellan

Photo of Drew McLellan

Drew McLellan has been hacking on the web since around 1996 following an unfortunate incident with a margarine tub. Since then he’s spread himself between both front- and back-end development projects, and now is Director and Senior Web Developer at edgeofmyseat.com in Maidenhead, UK (GEO: 51.5217, -0.7177). Prior to this, Drew was a Web Developer for Yahoo!, and before that primarily worked as a technical lead within design and branding agencies for clients such as Nissan, Goodyear Dunlop, Siemens/Bosch, Cadburys, ICI Dulux and Virgin.net. Somewhere along the way, Drew managed to get himself embroiled with Dreamweaver and was made an early Macromedia Evangelist for that product. This lead to book deals, public appearances, fame, glory, and his eventual downfall.

Picking himself up again, Drew is now a strong advocate for best practises, and stood as Group Lead for The Web Standards Project 2006-08. He has had articles published by A List Apart, Adobe, and O’Reilly Media’s XML.com, mostly due to mistaken identity. Drew is a proponent of the lower-case semantic web, and is currently expending energies in the direction of the microformats movement, with particular interests in making parsers an off-the-shelf commodity and developing simple UI conventions. He writes here at all in the head and, with a little help from his friends, at 24 ways.