Thank you for getting me to read that article, I've seen it floating around there for awhile and never bothered to read it.
Ignore that article, it's crap.
First off: he's using BLOB to store text!
WTF?!?!?!?!
BLOB should be data we never want to interpret. Binary Data such as images, flash files, .pdf's and other binary formats or other data that may be harmfull and corruptive to the database if it ever tried to interpret it.
All databases have a TEXT type field.
Not varchar or char, but TEXT, for long lengthy lines of text text text!
Why not use that.
He opens his article with how searching in his blob field returns no meaningful results,
well... considering that the database wont ever try to interpret the data in a BLOB type, it's no wonder.
Secondly, this gem:
$filtered = trim($filtered);
$filtered = addslashes($filtered);
$querywords = ereg_replace(",","",$filtered);
$querywords = ereg_replace(" ",",",$querywords);
$querywords = ereg_replace("\?","",$querywords);
$querywords = ereg_replace("(","",$querywords);
$querywords = ereg_replace(")","",$querywords);
$querywords = ereg_replace(".","",$querywords);
$querywords = ereg_replace(",","','",$querywords);
$querywords = ereg_replace("","'",$querywords);
$querywords = ereg_replace("$","'",$querywords);
And how many eregs do we use for what?!
1st thing wrong is just how wasteful that is in calling the same function repeatedly to do so little, a newbie should look at that and understand that is inneficient.
And ereg is a poor performer compared to preg functions.
he could have done this:
$patterns = array('/?/','/(/','/)/', ... );
$replace = array ('/'/','','', ... );
$querywords = preg_replace($patterns,$replace,addslashes(trim($filtered)));
...would have been far more efficient.
Also, that lil list of 'noisewords'
looks to me that could lead to certain words being ommited from a search that could be handy to have... like 'bad' for instance
what if you wanted to search for badmitten, bad mojo, bad boy?
The guy doesn't get it and his method would lead to the programmer or admin enslaving themselves to constantly tuning and tweaking words and rules of which are noise and which are not.
Bad scene all around.
In short, don't believe everything you read.