[PHP] Re: search parse? From: Jason Morehouse (jm <email protected>)
Date: 06/15/02

If you use fulltext search (assuming you are using MySQL), it deals with stop
words on its own as well as some additional search logic.

http://www.mysql.com/doc/F/u/Fulltext_Search.html

-J

On Sat, 15 Jun 2002 10:19:04 +1200, Ed Lazor wrote:

> Does anyone have a good function for parsing a search string into SQL? I
> know it will depend on the name of the field and table I'm searching
> through. Anything close will be helpful. An example search string
> would be:
>
> beer AND pizza NOT anchovies
>
> and the resulting search string would be
>
> select ID, Title from Products where Title like '%beer%' AND Title like
> '%pizza%' AND Title NOT LIKE '%anchovies%';
>
>
> Another example search string would be:
>
> beer OR pizza AND movies
>
> Thanks! =)
>
> -Ed
>
>
> ****************************************************************************
> This message is intended for the sole use of the individual and entity
> to whom it is addressed, and may contain information that is privileged,
> confidential and exempt from disclosure under applicable law. If you
> are not the intended addressee, nor authorized to receive for the
> intended addressee, you are hereby notified that you may not use, copy,
> disclose or distribute to anyone the message or any information
> contained in the message. If you have received this message in error,
> please immediately advise the sender by reply email and delete the
> message. Thank you very much.
 

-- 
 Jason Morehouse (jm <email protected>)
 Netconcepts LTD, Auckland, New Zealand    
 * Linux: because rebooting is for adding hardware.

-- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php