I used a variant of this scheme a time ago and it worked well though I had not reached 2 000 records.
I separated the words using strtok(). Manu. PD: How large is the http://www.alenet.com DB; I searched the word 'the' (which is likely to be in every english doc) and it returned only 28 docs. Manu. "Cesar Cordovez" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Hi! > > I think that you will need a "keyword" table to speed up this procedure. > The basic idea is to create an index of words in your fields, > therefore you will not use "like" but "=" making things run much, much > faster. > > The steps for doing this are: > > 1. Every time you save a record in the table docs, take all the text > fields in it and separate it into words. You can use explode to do > this. Like for example: $words = explode(" ", $record["fieldone"] . " " > .$record["fieldtwo"], {etc, etc}); > > 2. save in the keyword table the non repeating words in the array with a > reference to the original document, for example the document id. > > 3. Then, if you want to search for, let say, people you will do: > > select distinct(docid) from keywords where word='people' > > and you will have a list (cursor) with all the documents that have the > word "people". > > Very fast. > > For an example of this, go to http://www.alenet.com and search for > something. With very little more effort you can add a spelling thingy > (type peeple on the search field) and "porcentajes" for each document. > > I use the exactly the same procedure in a 5000 record database, and the > time it uses to search is about the same that in alenet.com > > Cesar > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php