My name sounds complicated, but the situation is very simple. People search on my site using a term like blackfriday.
When they do a search, my SQL code must search in different places, such as a field, ProductTitleand ProductDescriptionin order to find that term. For example:
SELECT *
FROM dbo.Products
WHERE ProductTitle LIKE '%blackfriday%' OR
ProductDescription LIKE '%blackfriday%'
However, this term looks different in the database fields. It looks most like a space between words like "Black Friday USA 2015." So, without going over and adding more combinations to the sentence WHERE, such as WHERE ProductTitle LIKE '%Black-Friday%', is there a better way to do such a fuzzy search?
I have a full-text search in the above fields, but its really not so good when I use the sentence CONTAINS. And, of course, other terms may not be as neat as this example.
source
share