On 2017-04-12 17:22, Mike wrote:
I found a Levenshtein function somewhere last year and have been using it with MariaDB as a function on the MariaDB server, called from my VFP 9 application. It's exceptionally fast and works pretty well.
My application needs to get "as close as" matches to a random string (for manufacturer product SKUs, which can be any length, any alphanumeric mishmash...example: RGB745WEHWW).
Sometimes the user enters everything right except one character, and this function returns a weighted list of "as close as I can find" known SKUs from a table of 45,000+.
I can send the function to anyone who is interested.
Here's an example of how I call it (the Levenshtien function is named klose, pcSearch is the text string to search for) select sku, klose(sku,?pcSearch) as score from (select sku from skus where soundex(sku) like soundex(?pcSearch)) as hits order by score desc limit 10
Mike Copeland
Hi Mike,
I'd love to see it. How about posting it on the ProFox downloads page so that it's easy for anybody to get?
Thanks! --Mike