Show similar results for mySQL

How to create a query that will return similar words if no exact match is found? For example, if the query tries to match "mstke", and if the word is not found in the database, then the results should contain similar words, such as "error", "error", "accept" and "fog".

I tried %LIKE%, but it displays the exact match of words.

+3
source share
3 answers

You can see if it works SOUNDEX(). I expect this to not work for every example you give, but maybe for some.

- , .

+3

Soundex. Soundex . soundex, , .

+2

to try

similar_text()
levenshtein() 
soundex()

Please check,

http://php.net/manual/en/function.similar-text.php

+1
source

Source: https://habr.com/ru/post/1765417/


All Articles