Most efficient way of doing this search?

From: BrandonR (blah_at_blah.com)
Date: 04/29/04

  • Next message: Virgil Green: "Re: unique situation, fopen, mysql can't be called"
    Date: Thu, 29 Apr 2004 03:40:40 GMT
    
    

    Basically I have a database full of entries that will be searchable with a
    script. Because of the likelyhood of slight misspellings and whatnot, I've
    also had the metaphone value of each entry in another field on the database
    as well, so that it looks like:

    Entry Metaphone
    ==== ========
    blah BL

    Anyways, the search I have thought of would take the user's search string,
    metaphone it, and loop through the whole database comparing the string and
    if the levenshtein value is below a certain number, it will display it as a
    result....

    Is this efficient? It seems inefficient to me to loop through the whole
    thing, but other solutions don't seem well enough. Originally I thought of
    cutting the string down to a few letters and doing a LIKE query on the
    database, but that either ends up with two many results or none if the word
    entered isn't one fo the first in the database's metaphone entry.

    Any other ideas on how to combine metaphone values and levenshtein in a good
    smart search?


  • Next message: Virgil Green: "Re: unique situation, fopen, mysql can't be called"

    Relevant Pages

    • Re: Most efficient way of doing this search?
      ... > Basically I have a database full of entries that will be searchable with a ... > also had the metaphone value of each entry in another field on the ... > Entry Metaphone ... > Anyways, the search I have thought of would take the user's search string, ...
      (alt.php)
    • Re: Compare string with a relevancy factor (VB 6.0 or VB .Net)
      ... Metaphone / Double MetaPhone ... > 1) Case does not matter ... Addresses in the database are not all in a valid format. ...
      (microsoft.public.vb.general.discussion)
    • Re: Serching of products correspondence
      ... For items not matched in this step, you can try using the metaphone ... cName = Barbie Funhouse, metaphone = BRBFNHS ... I have two tables with products in mysql database. ... I need to code php ...
      (comp.lang.php)
    • Re: preg_grep question
      ... a string, and the preg_grep looked like the best option. ... an entry out of the database, ... extended php parser ~ http://code.google.com/p/pihipi ...
      (comp.lang.php)
    • Re: A little Rolodex [revised]
      ... including alpha sort and searching for any embedded string, ... In this application, a database is a directory, ... you may optionally provide any alternate UCASE program, ... NN -> first store NN as key length ...
      (comp.sys.hp48)