logo
pub enum Fuzziness {
    Auto,
    Range(u8u8),
    Distance(u8),
}
Expand description

Some queries and APIs support parameters to allow inexact fuzzy matching, using the fuzziness parameter.

When querying text or keyword fields, fuzziness is interpreted as a Levenshtein Edit Distance  — the number of one character changes that need to be made to one string to make it the same as another string.

https://www.elastic.co/guide/en/elasticsearch/reference/current/common-options.html#fuzziness

Variants

Auto

Generates an edit distance based on the length of the term.

AUTO should generally be the preferred value for fuzziness.

Range(u8u8)

Low and high distance arguments may be optionally provided AUTO:[low],[high]. If not specified, the default values are 3 and 6, equivalent to AUTO:3,6 that make for lengths:

0..2

    Must match exactly

3..5

    One edit allowed

>5

    Two edits allowed

Distance(u8)

The maximum allowed Levenshtein Edit Distance (or number of edits)

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

Converts to this type from the input type.

Converts to this type from the input type.

Converts to this type from the input type.

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

Serialize this value into the given Serde serializer. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

Uses borrowed data to replace owned data, usually by cloning. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.