What if, when the business is added, there are a certain number of
textboxes, I'll use 10 as an example, and for that business you can put
in up to 10 phrases that someone might search for that business with. 
Then you don't need to put any other phrases in the database, just
single words.  This would keep the number of items that will be placed
in the keywords table to a minimum, and still allow people to search
with phrases.  We currently do something similar to this, but we also
store the soundex (PHP function) of each word or phrase and search those
also.  The soundex will return the records the person wanted even if
they misspelled the word or phrase they were looking for, or if the word
or phrase was misspelled when the business was added to the table. 
Sometimes the soundex isn't very accurate though, because it brings up
some records that have a different word that is spelled similarly.
-Angela


Anna wrote:
> 
> ----- Original Message -----
> From: "Geoff Coffey" <[EMAIL PROTECTED]>
> >I'm trying to decide how to enable searching from a web
> > form. <of a large text field>
> 
> Hi,
> 
> I have a similar question.
> I have a table of business. I need to be able to search the title and
> description.
> Right now I have just your plain WHERE businessTitle LIKE '%$keyword%' ||
> description LIKE '%$keyword%' .
> This worked fine for small tables, but now I need to deal with 100,000+
> records, and it isn't so fine.
> 
> Like Geoff I suspect that making a table of the keywords, then a table
> relating the keywordID to the businessID, would be better. But then you
> can't search phrases.
> 
> So I could make a table using this exercise from my computers class, which
> was:
> 
> Read the file into a string
> Split the string into three-word arrays
> Remove stop words from the phrase (like the, a, and, so on).
> Return all permutations of the remaining words (a b c, c a b, b c a, etc).
> Insert each of those permutations into the word table and relational table.
> 
> My question now is, this is going to get very big very fast. Should I worry
> about that at all? Or as long as I properly index it will it be okay?
> 
> Thanks!
> 
> Anna
> 
> ---------------------------------------------------------------------
> Before posting, please check:
>    http://www.mysql.com/manual.php   (the manual)
>    http://lists.mysql.com/           (the list archive)
> 
> To request this thread, e-mail <[EMAIL PROTECTED]>
> To unsubscribe, e-mail <[EMAIL PROTECTED]>
> Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php

-- 
Angela Curtis
Innovative Business Consultants
http://www.ibc2001.com

---------------------------------------------------------------------
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/           (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php

Reply via email to