pub struct Config {
pub max_typos: Option<u16>,
pub casing: CaseMatching,
pub unicode: UnicodeMatching,
pub matching: Matching,
pub sort: SortStrategy,
pub scoring: Scoring,
}Fields§
§max_typos: Option<u16>The maximum number of characters missing from the needle, before an item in the haystack is filtered out
casing: CaseMatchingControls how case sensitivity/insensitivity is handled while matching
unicode: UnicodeMatchingControls how unicode is handled while matching
matching: MatchingSelects the matching algorithm: fuzzy (Smith-Waterman) or one of the
literal modes (exact, prefix, suffix, substring). Literal modes
require the needle to appear as a contiguous run of characters and
do not support typos (max_typos is ignored).
sort: SortStrategyControls how results are ordered
scoring: ScoringControls the scoring used by the smith waterman algorithm. Pay close attention to the documentation for each property, as small changes can lead to poor matching.
Implementations§
Source§impl Config
impl Config
Sourcepub fn max_typos(self, max_typos: Option<u16>) -> Self
pub fn max_typos(self, max_typos: Option<u16>) -> Self
Sets the maximum number of typos allowed
Sourcepub fn casing(self, casing: CaseMatching) -> Self
pub fn casing(self, casing: CaseMatching) -> Self
Sets the casing mode
Sourcepub fn unicode(self, unicode: UnicodeMatching) -> Self
pub fn unicode(self, unicode: UnicodeMatching) -> Self
Sets the unicode mode
Sourcepub fn sort(self, sort: SortStrategy) -> Self
pub fn sort(self, sort: SortStrategy) -> Self
Sets how results are ordered