SimplifiedSearch 1.3.0-beta2

This is a prerelease version of SimplifiedSearch.
dotnet add package SimplifiedSearch --version 1.3.0-beta2                
NuGet\Install-Package SimplifiedSearch -Version 1.3.0-beta2                
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="SimplifiedSearch" Version="1.3.0-beta2" />                
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add SimplifiedSearch --version 1.3.0-beta2                
#r "nuget: SimplifiedSearch, 1.3.0-beta2"                
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install SimplifiedSearch as a Cake Addin
#addin nuget:?package=SimplifiedSearch&version=1.3.0-beta2&prerelease

// Install SimplifiedSearch as a Cake Tool
#tool nuget:?package=SimplifiedSearch&version=1.3.0-beta2&prerelease                

License: MIT Quality Gate Status

SimplifiedSearch

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.

Intended use case

Searching through lists of short phrases like country names or the subject line in emails.
Data in databases must first be loaded into memory in order to be searched.

.NET support

Tested with: .NETFramework4.8, NET6.0, NET8.0

Quickstart

Install

Nuget
> dotnet add package SimplifiedSearch

Code

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

Customization

New in version 1.3.0.

// Create searcher with custom selection of final result.
public class MyCustomSelector : SimplifiedSearch.SearchPipelines.ResultSelectors.IResultSelector
{
    public Task<IList<T>> RunAsync<T>(IList<SimilarityRankItem<T>> rankedList) => ...
}
SimplifiedSearchFactory.Instance.Add("MyCustomSearcher",
    c => c.ResultSelector = new MyCustomSelector());
var simplifiedSearch = SimplifiedSearchFactory.Instance.Create("MyCustomSearcher");
var searchResults = await simplifiedSearch.SimplifiedSearchAsync(list, "searchTerm");

// Override the default searcher, also used by the extension methods.
SimplifiedSearchFactory.Instance.Add(SimplifiedSearchFactory.DefaultName,
    c => c.ResultSelector = new MyCustomSelector());
var searchResults = await list.SimplifiedSearchAsync("searchTerm");

Acknowledgements

Inspiration

https://github.com/apache/lucenenet

Lucenenet is the main inspiration for SimplifiedSearch.
SimplifiedSearch was originally started with the goal of delivering similar results to a spesific setup of Lucene analyzer and query.

Enablers

https://github.com/DanHarltey/Fastenshtein

Provides the distance calculation needed for fuzzy search.
License: MIT https://github.com/DanHarltey/Fastenshtein/blob/master/LICENSE.

https://github.com/thecoderok/Unidecode.NET

Provides the ascii folding needed to match accented characters to their ascii approximate equivalent (â, å, à, á, ä ≈ a).
License: MIT https://github.com/thecoderok/Unidecode.NET/blob/master/LICENSE.

Contributing

Bug reports, feature requests and pull requests are welcome.

  • The focus of the project is in making the simple use case work well, not on supporting many special cases.
  • For significant changes, make an issue for discussion before putting significant work into the change.
  • Follow the established code format.
Product Compatible and additional computed target framework versions.
.NET net5.0 was computed.  net5.0-windows was computed.  net6.0 was computed.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 was computed.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed. 
.NET Core netcoreapp2.0 was computed.  netcoreapp2.1 was computed.  netcoreapp2.2 was computed.  netcoreapp3.0 was computed.  netcoreapp3.1 was computed. 
.NET Standard netstandard2.0 is compatible.  netstandard2.1 is compatible. 
.NET Framework net461 was computed.  net462 was computed.  net463 was computed.  net47 was computed.  net471 was computed.  net472 was computed.  net48 was computed.  net481 was computed. 
MonoAndroid monoandroid was computed. 
MonoMac monomac was computed. 
MonoTouch monotouch was computed. 
Tizen tizen40 was computed.  tizen60 was computed. 
Xamarin.iOS xamarinios was computed. 
Xamarin.Mac xamarinmac was computed. 
Xamarin.TVOS xamarintvos was computed. 
Xamarin.WatchOS xamarinwatchos was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
1.3.0-beta2 169 1/25/2024
1.3.0-beta1 390 12/19/2022
1.2.0 693 12/16/2022
1.2.0-beta.2 116 9/10/2022
1.2.0-beta.1 131 8/20/2022
1.1.5 670 1/9/2022
1.1.4 311 12/2/2021
1.1.3 291 12/1/2021
1.1.2 1,405 11/28/2021
1.1.0 1,184 11/20/2021
1.0.0 346 11/16/2021