How to search for similar words (spelling errors) in MYSQL

Asked

Viewed 113 times

0

I am building a search system using Mysql and PHP, with a fomulário in the _GET method.

I wanted to set up a system that if the person type wrong, the site can "correct" the word, or suggest the correct word.

The only way I thought is to have like a relationship table, ex:

tabela_relacoes
termo|variacao
maçã | macan
maçã |amaçã

Is there any better way to do that?

My search currently is like this:

SELECT *
FROM cadastros
WHERE titulo LIKE '%termo%'

where term is provided by $_GET['term'] in php search

No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.