Re: multiple words search query advise
| From: | Ryan A | Date: | Tue, 22 Mar 2005 00:35:26 +0000 |
| Subject: | Re: multiple words search query advise | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-211194@lists.php.net to get a copy of this message | ||
Hey!
Thanks! I'll look it up.
-Ryan
On 3/21/2005 5:53:38 AM, Brent Baisley (brent@landover.com) wrote:
> You want to use a full text index spanning the two fields. You
> wouldn't
> want to do a "LIKE" search because that wouldn't be able to use
>
>
> indexes, resulting in a full table scan every search.
>
> If you are using MySQL, you search read the part of the manual on
>
> creating and using full text indexes. It's really easy and exactly what
> you are looking for.
>
>
> On Mar 21, 2005, at 6:39 AM, Ryan A wrote:
>
> > Hi,
> > We have an a auction like site, now we have to add a search feature to
> > the
> > site, the searching will be done for 2 fields:
> > subject and description (ad_sub, ad_text).
> >
> > Since i have never done this before, I would appreciate some advise on
> > how
> > to do it.
> >
> > I was thinking of getting the search string, running an explode() on
> > it and
> > then doing a LIKE sql query to get the results on each word...but then
> > that
> > would add up to quite a bit if even 5 words were written (5 queries
> > each for
> > the subject and 5 for the text)
> >
> > Any help in the form of advise, links, code, examples etc would be
> > appreciated
--
No virus found in this outgoing message.
Checked by AVG Anti-Virus.
Version: 7.0.308 / Virus Database: 266.7.4 - Release Date: 3/18/2005