|
Posted by Brent Baisley on 10/01/18 11:11
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.
> After googleing a bit I have gotten a bit of help from some of the
> pages but
> not much, one very helpful bit of advise i got was to ignore works
> like:
> the, a, in
> as they are too common...if you have anymore to add, please feel free
> to
> write it.
>
>
> Thanks in advance,
> Ryan
>
>
>
> --
> 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
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
--
Brent Baisley
Systems Architect
Landover Associates, Inc.
Search & Advisory Services for Advanced Technology Environments
p: 212.759.6400/800.759.0577
Navigation:
[Reply to this message]
|