Enabling Fuzzy Search in C# .NET
Vložit
- čas přidán 1. 07. 2024
- Have you ever searched for a term misspelled and the search engine still gave you the right answers? How does it do that?
In this session, I'm going to introduce you to a simple and quick way to implement a capability called fuzzy search - which enables your application to search for a pattern in your data instead of an exact match.
Here's some useful links:
Read about SOUNDEX in SQL Server here:
learn.microsoft.com/en-us/sql...
Learn about DbFunctions here:
learn.microsoft.com/en-us/dot...
Here's the code I used in this video:
github.com/hassanhabib/FuzzyS...
Interestng. Two things I learned, 1) Soundex SQL statement 2) How to use DbFunction attribute. Thank you Hassan.
Same here
This video is saved to my library for years to come, plz don't remove it anytime soon
My co-developers need to see this.
So helpful. Have seen it many times on Bing but haven't had a requirement in any of my project yet.
Thanks for this hint.
Hoping to see more of these hidden capabilities more often.
Great video here Hassan! Short and highly informative
Excellent. Thank you very much Hassan.
Very very good explanation. I liked!
Second time i have learned from this channel, subscribed!
Awesome video. Never knew about this feature!
This is awesome... thank you. Your content is really good.
Very usefull topic. Simple and amazing solution. Thanks !
Superb, thanks for sharing.
Haw yousefool, thenk u HoShawn!
Lovely. Thanks for this.
Wow, just learned something new today!
Amazing as usual 👌
Soo understandable thank you teacher Hassan Habib
Crazy!! Thank You again mate..
First person I ever hit the bell for. Literal gold.
SOUNDEX can be useful, but it's a very crude "fuzzy search": It only looks at the first word of whatever is passed to it, and only the first few characters of that and gives good results only with English words. If you have a relatively short list of single words in English, it's not bad. For searching larger documents or multi-word phrases, it's almost useless. For better results, search for information on metaphone, double metaphone, metaphone 3, Levenshtein distance, Jaro-Winkler similarity, TfIdf ("term frequency, inverse document frequency) for starters.
add Damerau-Levenshtein
@carldaniel6510 indeed, I was making some tests now with the SOUNDEX function (btw Hassan great tip totally unknown for me before watching the video), and indeed in my case is not working as I'm trying to match some codes and a lot of matches are found since the codes always starts with PP and then some 8 chars after that.
I tried also work with the FuzzyString c# library that uses Levenshtein, Jaccard, Jaro-Winkler and others, but the problem is that the FuzzyString.ComparisonMetrics.ApproximatelyEquals cannot be directly translated to a linq to ef query. Anyone able to use some of those algos with EF*
I have been using SQL Server almost daily for the past several years..
It amazes me that there is much cool and useful things and hidden gems like this that I have never heard before!
Thanks for the amazing content, please keep it up and show us more hidden treasures 💐💐
It will be great if you make a series about hidden gems of SQL or in particular SQL Server
Very informative 👏 and plz make more videos like this
Great! as per your last comment, i checked the documentation for postgresql and it has the exact same function. Besides there is an additional function difference(text, text) return int that measures the similarity (not the difference) between two text.
Great video, thanks
so helpful 🙏 thanks for sharing this content
Very useful.👍
Thanx alooooooooot.
You are awesome bro
Didn't know about the cool stuff!
Seems good to have this function. Can you please demonstrate full text search as elastic search may do. Thank you for this video.
Will do!
Nice!!!.... thank you!
Thank you
Subscribed.
Awesome. I am new to .NET and C#. Can you please put such videos in a playlist. In case you already did that, then can you please share the link. Thank you so much. Your efforts are very helpful to me.
Great tip Hassan thank you! Can Soundex be applied with other languages?
If these languages can leverage ef or have their own mechanism
great!
Any notes on performance and indexes and such?
🙏
Really is that exist? I never knew this keyword before. [Subscribed]
Is there a function like SOUNDX that works with Arabic data?
I tried using SOUNDX with Arabic names data but it doesn't work..
Is there an alternative approach?
Hum, that's a good question. SOUNDEX relies on vowels which may or may not exist in other language. Certainly not in Arabic.
Some guy a while back wrote something to map vowels - check this out:
www.codeproject.com/articles/26880/arabic-soundex
@@HassanHabib
Thanks very much,
I will check it out.
Elasticsearch is way more scalable and popular
Good one. But the thing is, it is not working for sentences.
Love the idea ... still it's a capability of Sql Server, not C# .NET, ... for us folks who work with other DBs sadly useless :/
Yeah I had to mention that at the end - there might be other alternatives out there. Big question on performance and reliability.
The video title is deceiving, since it's about an SQL Server function, not about a .Net feature
Great explanation, bad title. its not in C# but more in Entity Framework in combination with SQL Server.
The title is quite misleading... this is about SQL Server and Entity Framework, not about C#...
Thank you