WARNING: Version 2.0 of Elasticsearch has passed its EOL date.
This documentation is no longer being maintained and may be removed. If you are running this version, we strongly advise you to upgrade. For the latest information, see the current release documentation.
Query DSL
editQuery DSL
editElasticsearch provides a full Query DSL based on JSON to define queries. Think of the Query DSL as an AST of queries, consisting of two types of clauses:
- Leaf query clauses
-
Leaf query clauses look for a particular value in a particular field, such as the
match
,term
orrange
queries. These queries can be used by themselves. - Compound query clauses
-
Compound query clauses wrap other leaf or compound queries and are used to combine
multiple queries in a logical fashion (such as the
bool
ordis_max
query), or to alter their behaviour (such as thenot
orconstant_score
query).
Query clauses behave differently depending on whether they are used in query context or filter context.