Re: Text Searches on MySQL

From: Date: Wed, 14 Mar 2001 19:28:55 +0000
Subject: Re: Text Searches on MySQL
References: 1  Groups: php.db 
Request: Send a blank email to php-db+get-7471@lists.php.net to get a copy of this message
At 05:05 PM 3/14/2001 +0000, you wrote:
I'm putting together a db with articles in it. Would it be better to have two tables with the main text of the articles in it linked to a main article table or just chuck it all in together in one table. I want to be able to do a full text search on the articles.
You cannot index "TEXT" fields in MySQL so doing a full text search is slow if you have any amount of data in your database (it needs to search every record for every search). The way I normally handle this is to create a second table of "words" which includes every word in a given article (that isn't in a stop word list) along with the original article ID so that I can index the strings. This makes a search very quick but adds the expense of disk space and slows the adding of data initially. You will have to decide whether in your case it matters. If you have little data then no big whoop. If you have lots of data then you need to look at different method of searching. Cheers, Ron -----------------------------------------------------------------------------
Island Net AMT Solutions Group Inc.          Telephone:          250 383-0096
1412 Quadra                                  Toll Free:        1 800 331-3055
Victoria, B.C.                               Fax:                250 383-6698
V8W 2L1                                      E-Mail:    support@islandnet.com
Canada                                       WWW:   http://www.islandnet.com/
-----------------------------------------------------------------------------

« previous php.db (#7471) next »