• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

How to implement did you mean this

 
fu bace
Greenhorn
Posts: 24
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am not sure if i wrote this on the right category.

My question is this. For example i have a product table and there is a column name product_title.

When user searches a record in this table, if he searchs for example "nokai n 97" or "nokai n97" i should say did you mean this "nokia n97".

I searched for string matchin algorithms and i found levensthein. I used it but it is so slow as expected.

What are your opinions about this subject. What should i do, how should i do?
 
Scott Selikoff
author
Saloon Keeper
Posts: 4031
18
Eclipse IDE Flex Google Web Toolkit
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
There's no simple way to implement what you are talking about. Many databases do implement Soundex functionality which converts the input to phonic sounds, in the hopes of finding things that sound the same, but it is far from perfect. The best you can do on a regular database would be to try 4-5 variations on the search, for example removing spaces, but that would branch the number of queries significantly. As far as I know, you need advance search tools, often 3rd party or home grown, to accomplish what you are talking about.
 
fu bace
Greenhorn
Posts: 24
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi i heard soundex too. But the language is a important point at that point.

You said 3rd party tool. I think I should use levensthein with Lucene, Solr or something else that are related to these which makes the select queries much faster by the help of indexes.
 
Jan Cumps
Bartender
Posts: 2608
14
C++ Linux Netbeans IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Try googling for "sql fuzzy search". Not too much to be found, but there are solutions for several databases. Maybe there is a match for your database.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic