OpenSearch/docs/reference/query-dsl/queries/flt-field-query.asciidoc
Simon Willnauer bc5a9ca342 Rename edit_distance/min_similarity to fuzziness
A lot of different API's currently use different names for the
same logical parameter. Since lucene moved away from the notion
of a `similarity` and now uses an `fuzziness` we should generalize
this and encapsulate the generation, parsing and creation of these
settings across all queries.

This commit adds a new `Fuzziness` class that handles the renaming
and generalization in a backwards compatible manner.

This commit also added a ParseField class to better support deprecated
Query DSL parameters

The ParseField class allows specifying parameger that have been deprecated.
Those parameters can be more easily tracked and removed in future version.
This also allows to run queries in `strict` mode per index to throw
exceptions if a query is executed with deprected keys.

Closes #4082
2014-01-09 15:14:51 +01:00

48 lines
1.5 KiB
Plaintext

[[query-dsl-flt-field-query]]
=== Fuzzy Like This Field Query
The `fuzzy_like_this_field` query is the same as the `fuzzy_like_this`
query, except that it runs against a single field. It provides nicer
query DSL over the generic `fuzzy_like_this` query, and support typed
fields query (automatically wraps typed fields with type filter to match
only on the specific type).
[source,js]
--------------------------------------------------
{
"fuzzy_like_this_field" : {
"name.first" : {
"like_text" : "text like this one",
"max_query_terms" : 12
}
}
}
--------------------------------------------------
`fuzzy_like_this_field` can be shortened to `flt_field`.
The `fuzzy_like_this_field` top level parameters include:
[cols="<,<",options="header",]
|=======================================================================
|Parameter |Description
|`like_text` |The text to find documents like it, *required*.
|`ignore_tf` |Should term frequency be ignored. Defaults to `false`.
|`max_query_terms` |The maximum number of query terms that will be
included in any generated query. Defaults to `25`.
|`fuzziness` |The fuzziness of the term variants. Defaults
to `0.5`. See <<fuzziness>>.
|`prefix_length` |Length of required common prefix on variant terms.
Defaults to `0`.
|`boost` |Sets the boost value of the query. Defaults to `1.0`.
|`analyzer` |The analyzer that will be used to analyze the text.
Defaults to the analyzer associated with the field.
|=======================================================================