On 25 Nov 2009, at 09:13, INDRANIL MUKHERJEE wrote:

> how can i implement soundex algorithm in rails app??
> my database is mysql
> I want to search a particular table's data using soundex

Model.all(:conditions => ["SOUNDEX(my_field)=?",soundex_string])

or

Model.all(:conditions => ["my_field SOUNDS LIKE ?",normal_string])

It's all right there in the mysql manual: 
http://dev.mysql.com/doc/refman/5.0/en/string-functions.html


Best regards

Peter De Berdt

--

You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.


Reply via email to