Re: keyword searching

From: Date: Wed, 12 Nov 2003 18:50:16 +0000
Subject: Re: keyword searching
References: 1 2 3 4 5  Groups: php.db 
Request: Send a blank email to php-db+get-31549@lists.php.net to get a copy of this message
On 12/11/03 12:24 -0600, Adam Williams wrote: > So as you can see, its gonna need some work to make it do fulltext > searching of the descr field. I'm not really sure how to make it do a > keyword search, either since "holmes*north*carolina" doesn't work > because it only searches for those words in that order, if descr field > in the database contains "north carolina holmes" it won't return that > result, but I want it to because the person using the db is looking for > all the fields that contain holmes, north, and carolina. On MySQL may be a query like this should do the trick... select * from match_test where mytext like "%north%" and mytext like "%holmes%" and mytext like "%carolina%"; An intersection of the results of independent matches, or simply put an "and" logic. This query would be pretty slow on large databases I suppose. HTH -- CCK./ cck[at]ilug-hyd.org.in/cck[@]mail15.com <http://hserus.net/~cck> "Passion and gradualness" -- Pavlov.

« previous php.db (#31549) next »