5 exercises on Elasticsearch Query DSL vocabulary.
0 / 5 completed
1 / 5
What is the difference between a term query and a match query in Elasticsearch?
term vs match:term looks for an exact value in a keyword field — no analysis. match applies the same analyzer used at index time, tokenizing and lowercasing, making it the right choice for full-text fields.
2 / 5
What does a bool query allow you to combine?
bool query:must (AND, affects score), should (OR, boosts score), must_not (NOT, no score), and filter (AND, no score, cacheable). Mixing them handles most real-world search requirements.
3 / 5
Why use a filter context instead of query context for range or term conditions?
Filter context: conditions in filter are answered with yes/no and the result is cached in the filter cache. No scoring computation means they are significantly faster for exact matches and numeric ranges.
4 / 5
What is an aggregation in Elasticsearch?
Aggregation: similar to SQL GROUP BY. Bucket aggregations (terms, range, date_histogram) group documents; metric aggregations (avg, sum, max) compute statistics. They run alongside search for faceted analytics.
5 / 5
What is the _source field and how can you optimize it?
_source: Elasticsearch stores the full original JSON so it can be returned in hits. Enabling source filtering (_source: ["title","price"]) or disabling unused large fields reduces storage and network overhead.