Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to search a 'near word' in MySQL?

Tags:

php

mysql

For example, I want to search a word 'marple', this should return row with near or exact word like 'marble','maple','marple', etc...

How to do it in mysql query? or better give word suggestion if any?

like image 557
Trez Avatar asked Apr 13 '10 06:04

Trez


2 Answers

SOUNDEX function.

"Two strings that sound almost the same should have identical soundex strings."

like image 110
Egor Pavlikhin Avatar answered Nov 15 '22 12:11

Egor Pavlikhin


In MySQL you can try use soundex function, but it's not a real solution. Use Sphinx or Lucene.

like image 29
Piotr Gwiazda Avatar answered Nov 15 '22 14:11

Piotr Gwiazda