Table of Contents

Method Fuzzy

Namespace
TantivyDotNet
Assembly
TantivyDotNet.dll

Fuzzy(string, string, int, bool, bool)

Matches terms of a text field within distance edits (insertions, deletions, substitutions) of value.

public static FuzzyQuery Fuzzy(string field, string value, int distance = 1, bool transpositions = true, bool prefix = false)

Parameters

field string

An indexed text field.

value string

The term to approximate. Not analyzed (see Term(string, string)), so pass it lowercased for the default tokenizer.

distance int

Maximum edit distance, 0 to 2.

transpositions bool

Count swapping two adjacent characters as one edit instead of two.

prefix bool

Match terms that start with something within the distance (search-as-you-type).

Returns

FuzzyQuery