M.V.
M.V.

Reputation: 1672

Efficient MySQL search

I have use InnoDB tables and I need to make a search inside...

Let say I have row

 1. asda
 2. asdda
 3. xyz

I want to search for asda...

It would be smth like SELECT * FROM table WHERE myC LIKE 'asda'... What I want to do is to show 'asda' and 'asdda' becouse it is almost familiar... Is there any efficient way to do this? MATCH(myC) AGAINST 'asda' is only available in myISAM table type..

Thank you for the answer!

Upvotes: 0

Views: 301

Answers (1)

Marc B
Marc B

Reputation: 360652

A very basic version would be to use the SOUNDEX() function in MySQL:

SELECT *
FROM table
WHERE SOUNDEX(myC) = SOUNDEX('asda');

or you can look into trying for Levenshtein Distance, which would be a bit more foolproof but is computationally much more expensive.

Upvotes: 1

Related Questions