correcting misspelled words in a search input
Posted: Fri Mar 11, 2005 6:05 am
Hello,
I would like to optimize the search function on my website and implement a sort of correcting function for misspelled words.
If the string doesn't match any word in my mysql field, I begin to search "select * from mytable where field like '%_tring%'" and then s_ring, st_ing, etc... Then I search for %tring, s%ring, st%ing, etc...
Is this a good way to procede ? How can I make my script better ?
I've searched for tutorials or scripts-examples for functions like this with no results, if you know anything about this, I would really appreciate an answer!
I would like to optimize the search function on my website and implement a sort of correcting function for misspelled words.
If the string doesn't match any word in my mysql field, I begin to search "select * from mytable where field like '%_tring%'" and then s_ring, st_ing, etc... Then I search for %tring, s%ring, st%ing, etc...
Is this a good way to procede ? How can I make my script better ?
I've searched for tutorials or scripts-examples for functions like this with no results, if you know anything about this, I would really appreciate an answer!