Friday, August 12, 2005

PHP Benchmark

Ulfe Rompe has a good post about problems with benchmarking PHP using microtime().

Thursday, August 11, 2005

MYSQL Full Text index stop words

One potentially annoying bit about full-text index searching on MySQL is the minimum word length. The English language abounds with meaningful three-character nouns. Our database contains a few of them, like war and dog. MYSQL considers these stop words and excludes them from a search. The default configuration (4+ character words are searchable) can be changed by modifying the ft_min_word_len system variable.

Wednesday, August 10, 2005

If you don't succeed at first, RTFM

Yeah, I know it doesn't work because I tried it, and then afterwards the manual told me it wouldn't work. It would be nice to be able to search a subset of columns in the full text index but it cannot be done quite so simply as naming those column in the MATCH() function. According to the MySQL documentation:

"For natural-language full-text searches, it is a requirement that the columns named in the MATCH() function be the same columns included in some FULLTEXT index in your table. For the preceding query, note that the columns named in the MATCH() function (title and body) are the same as those named in the definition of the article table's FULLTEXT index. If you wanted to search the title or body separately, you would need to create FULLTEXT indexes for each column. "

Tuesday, August 09, 2005

Indexslyia

Reworking a MySQL database search script in PHP to take advantage of MySQL 4.0+ boolean full text searching. Problems running into:

  • Creating the index. If you create a full text index on some of the fields in your table via PhpMyAdmin, say, and a subsequent test search yields an error message like: "Can't find FULLTEXT index matching the column list," try this command:
  • create fulltext index myindex_name on table (fieldname1,fieldname2,fieldname3,fieldname4);