0

I'm trying to search products from product table which are mostly matched by characters. For this case I'm using this query.

SELECT * 
FROM Product 
WHERE CONTAINS([Name], '"shirt" OR "pant" OR "popular"')

This query is ok when users searching by exactly correct spelled words. But I want a query string that can suggest expected result when someone incorrectly spelled, like shart, pent or populer.

Is there any solution?

Jaber
  • 277
  • 2
  • 10
  • 30
  • 1
    There appears to be quite a bit of coverage on fuzzy matching with SQL Server. You should review this material first, then come back with a more focused question, ideally an attempted query. – Tim Biegeleisen Oct 26 '17 at 06:08
  • This question is far far away from the 'duplicated' one. Please check it again and show another question which is most similar to this question so that I can get help. @TimBiegeleisen – Jaber Oct 26 '17 at 06:28
  • No, I disagree with you, and your question strongly implies that you want to do fuzzy matching with text. Someone else is free to reopen your question if he feels I am incorrect here. – Tim Biegeleisen Oct 26 '17 at 06:29
  • Both of these question may asking about fuzzy matching, though I'm not familiar with fuzzy. That doesn't mean both are same. These two are asking two different thing in same topic. – Jaber Oct 26 '17 at 06:33
  • 1
    Take a look at the UDF on the answer with +15 point bounty. It returns a similarity value for each match. You could set a threshhold for your query and then use that to determine if a word is close enough to a match to count as a bona fide match. – Tim Biegeleisen Oct 26 '17 at 06:35

0 Answers0