| 123456789101112131415161718192021222324252627282930313233343536373839404142 | [[query-dsl]]= Query DSL[partintro]--*elasticsearch* provides a full Query DSL based on JSON to definequeries. In general, there are basic queries such as<<query-dsl-term-query,term>> or<<query-dsl-prefix-query,prefix>>. There arealso compound queries like the<<query-dsl-bool-query,bool>> query. Queries canalso have filters associated with them such as the<<query-dsl-filtered-query,filtered>> or<<query-dsl-constant-score-query,constant_score>>queries, with specific filter queries.Think of the Query DSL as an AST of queries. Certain queries can containother queries (like the<<query-dsl-bool-query,bool>> query), others cancontain filters (like the<<query-dsl-constant-score-query,constant_score>>),and some can contain both a query and a filter (like the<<query-dsl-filtered-query,filtered>>). Each ofthose can contain *any* query of the list of queries or *any* filterfrom the list of filters, resulting in the ability to build quitecomplex (and interesting) queries.Both queries and filters can be used in different APIs. For example,within a <<search-request-query,search query>>, oras an <<search-aggregations-bucket-filter-aggregation,aggregation filter>>.This section explains the components (queries and filters) that can form theAST one can use.Filters are very handy since they perform an order of magnitude betterthan plain queries since no scoring is performed and they areautomatically cached.--include::query-dsl/queries.asciidoc[]include::query-dsl/filters.asciidoc[]
 |