View Single Post
Old 09-22-2003, 12:30 PM   #4
Rolandks
Purple Mole
 
Rolandks's Avatar
 
Join Date: Sep 2003
Location: Kassel, Germany
Posts: 119
Perhaps i have easy solution for this:

:: SOUNDEX :: LOOK Here

SOUNDEX - Calculates the soundex key of string.

You must add a new table-field an insert all SOUNDEX of the keywords. Perhaps as new Link in Admin-Menu (generate alternate words)

If Search-HIT < 1 or 2 -as $variable in config.php- you look at the sondex-table:

For my example above:

SOUNDEX(management) = M525
SOUNDEX(manager) = M526

Did you mean: is here near next >= M525
AND
SOUNDEX(operator) = O163
SOUNDEX(operating) = O163

SOUNDEX(ranked) = R523
SOUNDEX(ranking) = R525

Did you mean: is here near next > R523

The soundex 'different letter in front' problem can be solved by using levenshtein() on the soundex codes. See first User Contributed Notes at my Llink above.

OR direct in SQL LIKE:

$sql = "SELECT * FROM keywords WHERE substring(soundex(keyword), 1, 4) = substring(soundex('".$search_string."'), 1, 4)";

Hmm, does this work ?

-Roland-

Last edited by Rolandks; 09-22-2003 at 01:26 PM.
Rolandks is offline   Reply With Quote