Re: Searching on AlphaNumeric Content Only
| From: | Eddie Drapkin | Date: | Thu, 03 Sep 2009 19:24:58 +0000 |
| Subject: | Re: Searching on AlphaNumeric Content Only | ||
| References: | 1 2 3 4 5 6 7 8 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-297647@lists.php.net to get a copy of this message | ||
On Thu, Sep 3, 2009 at 3:17 PM, Ashley Sheridan<ash@ashleysheridan.co.uk> wrote:
> On Thu, 2009-09-03 at 12:12 -0700, sono-io@fannullone.us wrote:
>> Thanks to everyone who has responded. After reading everyone's
>> response, I think I have a very simple way to solve my "problem".
>>
>> Using my original example, if someone wants to find item #
>> 4D-2448-7PS, no matter what they type in, I'll take the input, strip
>> out all non-alphanumeric characters to make it 4D24487PS, add the
>> wildcard character between each of the remaining characters like so,
>> 4*D*2*4*4*8*7*P*S, and then do the search.
>>
>> Still being new at this, it seems to be the simplest approach, or is
>> my thinking flawed? This also keeps me from having to add another
>> field in the db to search on.
>>
>> BTW, this solution needs to work with any db, even ASCII files, so it
>> has to happen in PHP.
>>
>> Thanks again,
>> Frank
>>
> For speed you might want to consider an extra field in the DB in the
> future. If the database gets larger, or your query needs to join several
> tables together, then things will take a noticeable speed hit. I had a
> similar issue myself where I had to search for names based on
> mis-spellings of them. In the end I searched with metaphone tags on an
> extra field in the DB set up for that purpose, but it was the only way
> to do it that didn't affect the speed of the site.
>
> Thanks,
> Ash
> http://www.ashleysheridan.co.uk
>
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
Has anyone considered deploying an actual search engine (Solr, Sphinx,
etc.), as they will take care of the stripping, stemming, spelling
corrections, etc?