[[query-dsl]] = Query DSL [partintro] -- 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 <>, <> or <> 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 <> or <> query), or to alter their behaviour (such as the <> query). Query clauses behave differently depending on whether they are used in <>. [[query-dsl-allow-expensive-queries]] Allow expensive queries:: Certain types of queries will generally execute slowly due to the way they are implemented, which can affect the stability of the cluster. Those queries can be categorised as follows: * Queries that need to do linear scans to identify matches: ** <> * Queries that have a high up-front cost : ** <> (except on <> fields) ** <> (except on <> fields) ** <> (except on <> fields or those without <>) ** <> (except on <> fields) ** <> on <> and <> fields * <> * Queries on <> * Queries that may have a high per-document cost: ** <> ** <> The execution of such queries can be prevented by setting the value of the `search.allow_expensive_queries` setting to `false` (defaults to `true`). -- include::query-dsl/query_filter_context.asciidoc[] include::query-dsl/compound-queries.asciidoc[] include::query-dsl/full-text-queries.asciidoc[] include::query-dsl/geo-queries.asciidoc[] include::query-dsl/shape-queries.asciidoc[] include::query-dsl/joining-queries.asciidoc[] include::query-dsl/match-all-query.asciidoc[] include::query-dsl/span-queries.asciidoc[] include::query-dsl/special-queries.asciidoc[] include::query-dsl/term-level-queries.asciidoc[] include::query-dsl/minimum-should-match.asciidoc[] include::query-dsl/multi-term-rewrite.asciidoc[] include::query-dsl/regexp-syntax.asciidoc[]