reckfellENGINE

FuzzySearch

Provides fuzzy string searching and matching capabilities.

On this page
class FuzzySearchReckfellSharpInherits RefCounted

Provides fuzzy string searching and matching capabilities.

The fuzzy search algorithm is designed to find target strings which mostly match a query string while allowing for breaks, typos, and out of order matches.

C#
string[] items = ["Potion of Healing", "Greater Health Potion", "Poison Vial"];
FuzzySearch fuzzy = new();

foreach (var result in fuzzy.SearchAll("health potion", items))
{
    // Prints "Greater Health Potion", "Potion of Healing"
    ReckfellApi.Print(result.Target);
}

Declarations checked against C# SDK 1.0.0. Expand a name to see declarations and documentation.

Constructors1

FuzzySearchConstructor
# FuzzySearch
C#
public FuzzySearch();

Properties8

CaseSensitiveProperty
# CaseSensitive
C#
public bool CaseSensitive { get; set; }

Whether the query character casing should be matched exactly or not.

FilterCutoffProperty
# FilterCutoff
C#
public float FilterCutoff { get; set; }

Minimum score for filtering results returned by FuzzySearch.SearchAll.

FilterFactorProperty
# FilterFactor
C#
public float FilterFactor { get; set; }

Biases the filtering cutoff score between the average score and max score. Value should be between 0 and 1.

FilterLowScoresProperty
# FilterLowScores
C#
public bool FilterLowScores { get; set; }

If true, lower quality matches are not returned by FuzzySearch.SearchAll. The default filtering behavior is tuned to keep exact matches and reject significantly broken up matches. Setting this to false can potentially improve results when searching a small number of items.

MaxMissesProperty
# MaxMisses
C#
public int MaxMisses { get; set; }

Maximum number of non-matched characters in the query before skipping a target as non-matching. This option is ignored if FuzzySearch.UseExactTokens is true.

MaxResultsProperty
# MaxResults
C#
public int MaxResults { get; set; }

Maximum number of results which can be returned by FuzzySearch.SearchAll.

StartOffsetProperty
# StartOffset
C#
public int StartOffset { get; set; }

Number of leading characters to omit from matching. For example, this can be used to skip a common prefix such as asset://.

UseExactTokensProperty
# UseExactTokens
C#
public bool UseExactTokens { get; set; }

If true, only targets which contain each token as a non-overlapping substring are returned. Gaps and missed characters are not considered valid matches, but FuzzySearch.CaseSensitive is still used.

Methods19

GetCaseSensitivebool
# GetCaseSensitive
C#
public bool GetCaseSensitive();
Returns bool
GetFilterCutofffloat
# GetFilterCutoff
C#
public float GetFilterCutoff();
Returns float
GetFilterFactorfloat
# GetFilterFactor
C#
public float GetFilterFactor();
Returns float
GetFilterLowScoresbool
# GetFilterLowScores
C#
public bool GetFilterLowScores();
Returns bool
GetMaxMissesint
# GetMaxMisses
C#
public int GetMaxMisses();
Returns int
GetMaxResultsint
# GetMaxResults
C#
public int GetMaxResults();
Returns int
GetStartOffsetint
# GetStartOffset
C#
public int GetStartOffset();
Returns int
GetUseExactTokensbool
# GetUseExactTokens
C#
public bool GetUseExactTokens();
Returns bool
SearchFuzzySearchMatch
# Search
C#
public FuzzySearchMatch Search(string query, string target);

Searches the target for query, returning a FuzzySearchMatch instance on success or null otherwise.

Parameters
NameTypeDefault
querystring—
targetstring—
Returns FuzzySearchMatch
SearchAll2 overloads
# SearchAll · 1/2
C#
public Reckfell.Collections.Array<FuzzySearchMatch> SearchAll(string query, ReadOnlySpan<string> targets);

Searches all of targets for query and returns up to the top FuzzySearch.MaxResults scoring values. The results are sorted by score in descending order. Low quality results are removed if FuzzySearch.FilterLowScores is true.

Parameters
NameTypeDefault
querystring—
targetsReadOnlySpan<string>—
Returns Reckfell.Collections.Array<FuzzySearchMatch>
# SearchAll · 2/2
C#
public Reckfell.Collections.Array<FuzzySearchMatch> SearchAll(string query, string[] targets);

Searches all of targets for query and returns up to the top FuzzySearch.MaxResults scoring values. The results are sorted by score in descending order. Low quality results are removed if FuzzySearch.FilterLowScores is true.

Parameters
NameTypeDefault
querystring—
targetsstring[]—
Returns Reckfell.Collections.Array<FuzzySearchMatch>
SetCaseSensitivevoid
# SetCaseSensitive
C#
public void SetCaseSensitive(bool caseSensitive);
Parameters
NameTypeDefault
caseSensitivebool—
SetFilterCutoffvoid
# SetFilterCutoff
C#
public void SetFilterCutoff(float filterCutoff);
Parameters
NameTypeDefault
filterCutofffloat—
SetFilterFactorvoid
# SetFilterFactor
C#
public void SetFilterFactor(float filterFactor);
Parameters
NameTypeDefault
filterFactorfloat—
SetFilterLowScoresvoid
# SetFilterLowScores
C#
public void SetFilterLowScores(bool filterLowScores);
Parameters
NameTypeDefault
filterLowScoresbool—
SetMaxMissesvoid
# SetMaxMisses
C#
public void SetMaxMisses(int maxMisses);
Parameters
NameTypeDefault
maxMissesint—
SetMaxResultsvoid
# SetMaxResults
C#
public void SetMaxResults(int maxResults);
Parameters
NameTypeDefault
maxResultsint—
SetStartOffsetvoid
# SetStartOffset
C#
public void SetStartOffset(int startOffset);
Parameters
NameTypeDefault
startOffsetint—
SetUseExactTokensvoid
# SetUseExactTokens
C#
public void SetUseExactTokens(bool useExactTokens);
Parameters
NameTypeDefault
useExactTokensbool—
Reckfell Engine documentationBack to top ↑
QUICK LINKSGetting startedEntity hierarchyC# & .NET 10Scenes and prefabs
Reckfell guides and full API K
reckfellENGINE
RECKFELL ACCOUNT

Sign in

Sign in to your Reckfell account.

One account for the entire Reckfell platform.