Struct elasticsearch_dsl::search::queries::term_level::FuzzyQuery [−][src]
pub struct FuzzyQuery { /* fields omitted */ }
Expand description
Returns documents that contain terms similar to the search term, as measured by a Levenshtein edit distance.
An edit distance is the number of one-character changes needed to turn one term into another. These changes can include:
- Changing a character (box → fox)
- Removing a character (black → lack)
- Inserting a character (sic → sick)
- Transposing two adjacent characters (act → cat) To find similar terms, the fuzzy query creates a set of all possible variations, or expansions, of the search term within a specified edit distance. The query then returns exact matches for each expansion.
To create a fuzzy query with numeric values:
Query::fuzzy("test", 123);
To create a fuzzy query with string values and optional fields:
Query::fuzzy("test", "username")
.boost(2)
.name("test");
https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-fuzzy-query.html
Implementations
Maximum edit distance allowed for matching. See Fuzziness for valid values and more information. See Fuzziness in the match query for an example.
Maximum number of terms to which the query will expand.
Defaults to 50
.
Number of beginning characters left unchanged for fuzzy matching.
Defaults to 0
.
Indicates whether edits include transpositions of two adjacent characters (ab → ba).
Defaults to true
Method used to rewrite the query. For valid values and more information, see the rewrite parameter.
Floating point number used to decrease or increase the
relevance scores
of a query. Defaults to 1.0
.
You can use the boost parameter to adjust relevance scores for searches containing two or more queries.
Boost values are relative to the default value of 1.0
.
A boost value between 0 and 1.0
decreases the relevance score.
A value greater than 1.0
increases the relevance score.
You can use named queries to track which queries matched
returned documents. If named queries are used, the response
includes a matched_queries
property for each hit.
Trait Implementations
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 !=
.
Auto Trait Implementations
impl RefUnwindSafe for FuzzyQuery
impl Send for FuzzyQuery
impl Sync for FuzzyQuery
impl Unpin for FuzzyQuery
impl UnwindSafe for FuzzyQuery
Blanket Implementations
Mutably borrows from an owned value. Read more