Re: Searching on AlphaNumeric Content Only
| From: | Robert Cummings | Date: | Fri, 04 Sep 2009 20:36:08 +0000 |
| Subject: | Re: Searching on AlphaNumeric Content Only | ||
| References: | 1 2 3 4 5 6 7 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-297692@lists.php.net to get a copy of this message | ||
Eddie Drapkin wrote:
On Fri, Sep 4, 2009 at 12:02 PM, Lupus Michaelis<mickael+php@lupusmic.org> wrote:I've just sort of stopped in on this thread... but why isn't MySQL's FULLTEXT engine being considered? Cheers, Rob. -- http://www.interjinn.com Application and Templating Framework for PHPAshley Sheridan a écrit :So far, in this thread, there've been a few solutions: 1) LIKE in SQL. 2) REGEXP in SQL. 3) PCRE in PHP 4) Other fetch all methods in PHP. The one thing that I'm seeing as a consistent agreement is that the performance hit of whichever of the aforementioned measures is going to be enough to be considering something else. I briefly mentioned - I apologize for the brevity of that email because I was in a hurry - that a legitimate full text search engine is the right solution to this problem. The only problem with deploying a full text search engine is going to be the difficulty in the deployment and perhaps issues if you're on shared hosting (but then again I am of the opinion that those who choose to run with shared hosting dig their own graves in more ways than one). What a full text search engine gives you is flexibility in your searches, such that the initial question, when I read it, I thought "Oh, someone will tell him to use Sphinx or Solr as both have special filters for word seperation and would handle this without any special instruction." Instead, this is never even brought up! Why was using a full text search engine to do this sort of thing - not to mention the other benefits that it would bring (responsiveness and flexibility in searching, speed, decreased use of MySQL, etc. etc.) - rejected so offhandedly? I can't actually think of a better way to do this without requiring a whole heap of overhead, either processing or programming.You'll have far greater performance issues if you retrieve all those records and attempt to do the same thing inside of PHP...It's why I speak about « avoiding » and not « bannishing ». Like can be usefull, I used to use it. But it is not the a good answer to all problems. The problem with like operator is it can't use the index (or in a very limited way). So I try to warn about it. So said, I never submit an all-retrieving method. I know it isn't the solution too. -- Mickaël Wolff aka Lupus Michaelis http://lupusmic.org -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php