Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Closest match for Full Text Search

I am trying to implement an internal search for my website that can point users in the right direction in case the mistype a word, something like the did you mean : in google search.

Does anybody have an idea how such a search can be done? How can we establish the relevance of the word or the phrase we assume the user intended to search for?

  • i use asp.net and sql server 2005 with FTS (fullTextSearch)

Thank you

like image 839
ak3nat0n Avatar asked Jan 15 '09 22:01

ak3nat0n


1 Answers

You could use an algorithm for determining string similarity and then suggest other string from your search index up to a certain difference.

One of these algorithms is the Levenshtein distance.

However, don't forget searching for existing solutions. I think e.g. Lucene has the capability to search for similar strings.

Btw, here's a related post on this topic: How does the Google “Did you mean?” Algorithm work?

like image 108
Dirk Vollmar Avatar answered Sep 30 '22 06:09

Dirk Vollmar