Re: search parse?
| From: | Jason Morehouse | Date: | Sat, 15 Jun 2002 18:58:45 +0000 |
| Subject: | Re: search parse? | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-102318@lists.php.net to get a copy of this message | ||
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@netconcepts.com)
Netconcepts LTD, Auckland, New Zealand
* Linux: because rebooting is for adding hardware.