Take the 2-minute tour ×
Database Administrators Stack Exchange is a question and answer site for database professionals who wish to improve their database skills and learn from others in the community. It's 100% free, no registration required.

Is there a way to configure fuzzy searches in sql server full text search. Meaning if I search for a term called POWDER, I must get matches (i.e. strings) which contain any variations of it within an allowable distance, like for e.g. the matches can be strings which can contain the following variations of the previously mentioned word:

PWDR (distance = 2)
PWDER (distance = 1)
WDER (distance = 2)

I remember reading somewhere you can do this kind of thing, however this specifically requires you to specify the allowable edit distance. How or where do you do this?

share|improve this question
    
There's no specific implementation of the classical Fuzzy Search (with distance) in 2008 R2 FTS. However, there is one in SQL 2012, it's using the NEAR operator. See this question (and its answers) for some guidelines of what's available. Some options would be: SSIS Fuzzy lookup operator, [Fuzzy logic in Master Data Services], use a T-SQL algorithm. –  Marian Apr 6 '13 at 12:50
    
An example of how you'd be able to use SSIS for fuzzy match on SQLServerCentral. And for Master Data Services fuzzy functions here. –  Marian Apr 6 '13 at 12:51
1  
The NEAR operator does NOT allow for fuzzy matching of strings. It allows to express something like "word X must be at most 5 words away from word Y". –  Andreas Jan 27 at 8:17

2 Answers 2

You could try an implementation of one of the string distance functions. Here's a T-SQL implementation of the Levenshtein distance taken from here. That post does suggest there's a performance issue with the function and scalar functions generally can be bad for performance when used in queries, but worth a look. You could always try and convert it to a table function.

enter image description here

share|improve this answer

This is not possible with current editions of sql server. You may have more luck using some external indexing tool like Lucene.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.