tags:

views:

29

answers:

3

Hi, i want select similar rows accourding to row's title columun. Title columun has mostly have 5 or 6 six keywords. Which algorithm do you recommend ? Soundex Maybe ?

P.S: Title columun has unicode chracters like Ç, Ö, Ş...

A: 

If you mean similar in spelling and pronunciation, I'd look into using the SOUNDEX function.

amphetamachine
A: 

Honestly, I'd create a table for keywords(id, external_id, keyword), and then I would join the table against itself, order by how many matches there are, and then grab the rows back out.

If you're matching against a single row, you can select only that one, for much better efficiency with the join.

This could be combined with SOUNDEX to match together things that are close

zebediah49
A: 

My question's answer mysql full text search. Also it supports unicode.

    SELECT *, match(project_title) against('sample project 55') as similarity
    FROM projects
    WHERE status IN(1, 2, 3, 4, 5, 6) AND id != ? AND match('sample project 55') against(?)
    ORDER BY similarity DESC
mTuran