Re: MySQL or PHP Trick to get most relevant results?
| From: | jeremy brand | Date: | Wed, 08 Nov 2000 22:24:35 +0000 |
| Subject: | Re: MySQL or PHP Trick to get most relevant results? | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-24402@lists.php.net to get a copy of this message | ||
In MySQL:
1) you could build a reverse index of key words.
2) you could use the mysql >= 3.23.23 text indexing functions
3) (ouch) you could do a "like" clause.
-jeremy brand
http://www.JeremyBrand.com/Jeremy/Brand/Jeremy_Brand.html
for more
---------------------------------------------------------------------
We cannot do everything at once, but we can do something at once.
-- Calvin Coolidge
On Wed, 8 Nov 2000, Roy Nasser wrote:
> Date: Wed, 8 Nov 2000 20:23:42 -0300
> From: Roy Nasser <roy@vem.ca>
> To: "Php (E-mail)" <php-general@lists.php.net>
> Subject: [PHP] MySQL or PHP Trick to get most relevant results?
>
> Hi,
>
> I am searching through a database with a text field... I would like,
> however, to match some things such:
>
> Database contains:
> lollypop
> Chocolate cake
> steak
> cake
>
>
> When i query for "steak" I should get "steak" returned.
> When i query for "chocolate" I should get "Chocolate cake" returned.
> When i query for "cake" I should get "cake" and "chocolate cake"
> returned
> (in that order).
> When i query for "lollypop" I should get "lollypop" returned.
>
>
> Is there any ideas of ways to do this? Thanks!
>
> Roy
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net
> For additional commands, e-mail: php-general-help@lists.php.net
> To contact the list administrators, e-mail: php-list-admin@lists.php.net
>
>