Enum elasticsearch_dsl::search::queries::params::Fuzziness[][src]

pub enum Fuzziness {
    Auto,
    Range(Range<u8>),
    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(Range<u8>)

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

Tuple Fields of Range

0: Range<u8>
Distance(u8)

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

Tuple Fields of Distance

0: u8

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

Performs the conversion.

Performs the conversion.

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

Performs the conversion.

Performs the conversion.

The resulting type after obtaining ownership.

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

🔬 This is a nightly-only experimental API. (toowned_clone_into)

recently added

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.