I want to show similar products so called variants for the a product. Currently I am doing it as below:
public IList<Product> GetVariants(string productName)
{
EFContext db = new EFContext(); //using Entity Framework
return db.Products
.Where(product = > product.ProductName == productName)
.ToList();
}
But , this results into exact match, that is the current product itself. I am thinking to use Levenshtein Distance as a basis to get the similar products. But , before that I want to check what majority developers do for getting variants?
- Is it good to use Levenshtein Distance ? Is it used in industry for this purpose?
- Do I have to add another table in database showing the variants for the product while adding the product to database?