0

I have taken a string as input, and need to compare it with a large volume of data from the database. Basically i have to find the distance between the input string and stored strings of the database table

What would be the perfect and efficient solution for this kind of situation ?

Thanks in advance.

fean
  • 546
  • 4
  • 12
  • 37

1 Answers1

0

Try the answer from this SO question

Or see this.

Edit: Here's a function for Levenshtein distance in MySQL.

Edit2: An alternative would be to create an index of the strings you search in using a search engine like Lucene, which also supports Levenshtein distance in its queries.

Community
  • 1
  • 1
Thomas
  • 87,414
  • 12
  • 119
  • 157