2015-06-03 19:59:22 -04:00
|
|
|
[[term-level-queries]]
|
|
|
|
== Term level queries
|
|
|
|
|
|
|
|
While the <<full-text-queries,full text queries>> will analyze the query
|
|
|
|
string before executing, the _term-level queries_ operate on the exact terms
|
2018-05-03 04:23:14 -04:00
|
|
|
that are stored in the inverted index, and will normalize terms before executing
|
|
|
|
only for <<keyword,`keyword`>> fields with <<normalizer,`normalizer`>> property.
|
2015-06-03 19:59:22 -04:00
|
|
|
|
|
|
|
These queries are usually used for structured data like numbers, dates, and
|
|
|
|
enums, rather than full text fields. Alternatively, they allow you to craft
|
|
|
|
low-level queries, foregoing the analysis process.
|
|
|
|
|
|
|
|
The queries in this group are:
|
|
|
|
|
|
|
|
<<query-dsl-term-query,`term` query>>::
|
|
|
|
|
|
|
|
Find documents which contain the exact term specified in the field
|
|
|
|
specified.
|
|
|
|
|
|
|
|
<<query-dsl-terms-query,`terms` query>>::
|
|
|
|
|
|
|
|
Find documents which contain any of the exact terms specified in the field
|
|
|
|
specified.
|
|
|
|
|
2017-10-27 07:14:44 -04:00
|
|
|
<<query-dsl-terms-set-query,`terms_set` query>>::
|
|
|
|
|
|
|
|
Find documents which match with one or more of the specified terms. The
|
|
|
|
number of terms that must match depend on the specified minimum should
|
|
|
|
match field or script.
|
|
|
|
|
2015-06-03 19:59:22 -04:00
|
|
|
<<query-dsl-range-query,`range` query>>::
|
|
|
|
|
|
|
|
Find documents where the field specified contains values (dates, numbers,
|
|
|
|
or strings) in the range specified.
|
|
|
|
|
|
|
|
<<query-dsl-exists-query,`exists` query>>::
|
|
|
|
|
|
|
|
Find documents where the field specified contains any non-null value.
|
|
|
|
|
|
|
|
<<query-dsl-prefix-query,`prefix` query>>::
|
|
|
|
|
2016-08-02 20:10:13 -04:00
|
|
|
Find documents where the field specified contains terms which begin with
|
2015-06-03 19:59:22 -04:00
|
|
|
the exact prefix specified.
|
|
|
|
|
|
|
|
<<query-dsl-wildcard-query,`wildcard` query>>::
|
|
|
|
|
|
|
|
Find documents where the field specified contains terms which match the
|
|
|
|
pattern specified, where the pattern supports single character wildcards
|
|
|
|
(`?`) and multi-character wildcards (`*`)
|
|
|
|
|
|
|
|
<<query-dsl-regexp-query,`regexp` query>>::
|
|
|
|
|
|
|
|
Find documents where the field specified contains terms which match the
|
|
|
|
<<regexp-syntax,regular expression>> specified.
|
|
|
|
|
|
|
|
<<query-dsl-fuzzy-query,`fuzzy` query>>::
|
|
|
|
|
|
|
|
Find documents where the field specified contains terms which are fuzzily
|
|
|
|
similar to the specified term. Fuzziness is measured as a
|
|
|
|
http://en.wikipedia.org/wiki/Damerau%E2%80%93Levenshtein_distance[Levenshtein edit distance]
|
|
|
|
of 1 or 2.
|
|
|
|
|
|
|
|
<<query-dsl-type-query,`type` query>>::
|
|
|
|
|
|
|
|
Find documents of the specified type.
|
|
|
|
|
|
|
|
<<query-dsl-ids-query,`ids` query>>::
|
|
|
|
|
|
|
|
Find documents with the specified type and IDs.
|
|
|
|
|
|
|
|
|
|
|
|
include::term-query.asciidoc[]
|
|
|
|
|
|
|
|
include::terms-query.asciidoc[]
|
|
|
|
|
2017-10-27 07:14:44 -04:00
|
|
|
include::terms-set-query.asciidoc[]
|
|
|
|
|
2015-06-03 19:59:22 -04:00
|
|
|
include::range-query.asciidoc[]
|
|
|
|
|
|
|
|
include::exists-query.asciidoc[]
|
|
|
|
|
|
|
|
include::prefix-query.asciidoc[]
|
|
|
|
|
|
|
|
include::wildcard-query.asciidoc[]
|
|
|
|
|
|
|
|
include::regexp-query.asciidoc[]
|
|
|
|
|
|
|
|
include::fuzzy-query.asciidoc[]
|
|
|
|
|
|
|
|
include::type-query.asciidoc[]
|
|
|
|
|
|
|
|
include::ids-query.asciidoc[]
|