Skip to main content

Query DSL for Elasticsearchs

The Elasticsearch Query DSL is the JSON language used in the _search API to express queries. It separates full-text queries such as match, which are analyzed and scored, from term-level queries such as term and range, which match exact values, and combines them with the bool query.

Stage: Searching · Part of the Elasticsearch roadmap · Last reviewed 19 November 2026

What to learn in Query DSL

Query DSL interview questions

What is the difference between must and filter in a bool query?

Both require a document to match, but must clauses contribute to the relevance score while filter clauses do not. Filters are also cacheable and faster, so exact conditions like status or date ranges belong in filter.

Why is deep pagination with from and size a problem?

Each shard must build and sort from plus size hits, and the coordinating node merges them, so memory and time grow with depth. Elasticsearch caps this by default at 10,000 results. For deep paging, use search_after with a point in time.

Where Query DSL fits in the Elasticsearch roadmap

Query DSL belongs to the Searching stage (intermediate level), which takes about 15 hours. Queries and relevance.

Back to the full Elasticsearch roadmap