83 lines
2.4 KiB
Plaintext
83 lines
2.4 KiB
Plaintext
[[term-level-queries]]
|
|
== Term-level queries
|
|
|
|
You can use **term-level queries** to find documents based on precise values in
|
|
structured data. Examples of structured data include date ranges, IP addresses,
|
|
prices, or product IDs.
|
|
|
|
Unlike <<full-text-queries, full-text queries>>, term-level queries do not
|
|
analyze search terms. Instead, term-level queries match the exact terms stored
|
|
in a field.
|
|
|
|
|
|
[NOTE]
|
|
====
|
|
Term-level queries still normalize search terms for `keyword` fields with the
|
|
`normalizer` property. For more details, see <<normalizer, `normalizer`>>.
|
|
====
|
|
|
|
[discrete]
|
|
[[term-level-query-types]]
|
|
=== Types of term-level queries
|
|
|
|
<<query-dsl-exists-query,`exists` query>>::
|
|
Returns documents that contain any indexed value for a field.
|
|
|
|
<<query-dsl-fuzzy-query,`fuzzy` query>>::
|
|
Returns documents that contain terms similar to the search term. {es} measures
|
|
similarity, or fuzziness, using a
|
|
http://en.wikipedia.org/wiki/Levenshtein_distance[Levenshtein edit distance].
|
|
|
|
<<query-dsl-ids-query,`ids` query>>::
|
|
Returns documents based on their <<mapping-id-field, document IDs>>.
|
|
|
|
<<query-dsl-prefix-query,`prefix` query>>::
|
|
Returns documents that contain a specific prefix in a provided field.
|
|
|
|
<<query-dsl-range-query,`range` query>>::
|
|
Returns documents that contain terms within a provided range.
|
|
|
|
<<query-dsl-regexp-query,`regexp` query>>::
|
|
Returns documents that contain terms matching a
|
|
https://en.wikipedia.org/wiki/Regular_expression[regular expression].
|
|
|
|
<<query-dsl-term-query,`term` query>>::
|
|
Returns documents that contain an exact term in a provided field.
|
|
|
|
<<query-dsl-terms-query,`terms` query>>::
|
|
Returns documents that contain one or more exact terms in a provided field.
|
|
|
|
<<query-dsl-terms-set-query,`terms_set` query>>::
|
|
Returns documents that contain a minimum number of exact terms in a provided
|
|
field. You can define the minimum number of matching terms using a field or
|
|
script.
|
|
|
|
<<query-dsl-type-query,`type` query>>::
|
|
Returns documents of the specified type.
|
|
|
|
<<query-dsl-wildcard-query,`wildcard` query>>::
|
|
Returns documents that contain terms matching a wildcard pattern.
|
|
|
|
|
|
include::exists-query.asciidoc[]
|
|
|
|
include::fuzzy-query.asciidoc[]
|
|
|
|
include::ids-query.asciidoc[]
|
|
|
|
include::prefix-query.asciidoc[]
|
|
|
|
include::range-query.asciidoc[]
|
|
|
|
include::regexp-query.asciidoc[]
|
|
|
|
include::term-query.asciidoc[]
|
|
|
|
include::terms-query.asciidoc[]
|
|
|
|
include::terms-set-query.asciidoc[]
|
|
|
|
include::type-query.asciidoc[]
|
|
|
|
include::wildcard-query.asciidoc[]
|