Query DSL

Elasticsearch provides a full Query DSL (Domain Specific Language) based on JSON to define queries. Think of the Query DSL as an AST (Abstract Syntax Tree) 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 matcharrow-up-right, termarrow-up-right or rangearrow-up-right

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 boolarrow-up-right or dis_maxarrow-up-right query), or to alter their behaviour (such as the constant_scorearrow-up-right query).

Query clauses behave differently depending on whether they are used in query context or filter contextarrow-up-right.

Last updated

Was this helpful?