Simple way to add ranked fuzzy matching search. For when you have up to a few thousand products, locations or similar and want to add a search that most users will see as smart, with minimal work. using SimplifiedSearch; IList<Country> matches = await listOfCountries.SimplifiedSearchAsync("thaiwan", x => x.CountryName); foreach (var country in matches) Console.WriteLine(country.CountryName); // output: // Taiwan // Thailand
$ dotnet add package SimplifiedSearch
See Acknowledgements for additional license information covering parts of the project.
Simple way to add ranked fuzzy matching search.
For when you have up to a few thousand products, locations or similar and want to add a search that most users will see as smart, with minimal work.
Searching through lists of short phrases like country names or the subject line in emails.
Tested with: NETCOREAPP3.1, NET5.0, NET6.0
PM> Install-Package SimplifiedSearch
Use extension method .SimplifiedSearchAsync(searchTerm, propertyToSearchLambda).
propertyToSearchLambda is optional. When missing, all properties will be searched (or the value, if the value is string, Enum, int, etc).
using SimplifiedSearch;
IList<Country> countries = GetListOfCountries();
IList<Country> matches = await countries.SimplifiedSearchAsync("thaiwan", x => x.CountryName);
foreach (var country in matches)
{
Console.WriteLine(country.CountryName);
}
// output:
// Taiwan
// Thailand
Lucenenet is the main inspiration for SimplifiedSearch.
SimplifiedSearch was started with the goal of delivering similar results to a spesific setup of Lucene analyzer and query.
SimplifiedSearch was inspired by SearchExtensions, and delivers a simpler (and less configurable) experience.
Provides the distance calculation needed for fuzzy search.
https://github.com/DanHarltey/Fastenshtein/blob/master/LICENSE.
Provides the ascii folding needed to match accented characters to their ascii approximate equivalent (â, å, à, á, ä ≈ a).
https://github.com/thecoderok/Unidecode.NET/blob/master/LICENSE.
For test data tests/data/annexare/Countries/*.
tests/data/annexare/Countries/LICENSE.
For test data tests/data/CivilServiceUSA/us-states/*.
tests/data/CivilServiceUSA/us-states/LICENSE.
For test data tests/data/linanqiu/reddit-dataset/*.
tests/data/linanqiu/reddit-dataset/README.md (se bottom of readme).
Pull requests are welcome.