ElasticSearch ElasticSearch MCQ 4 — Questions and Answers
Question 1: Which Elasticsearch mechanism automatically moves shards between nodes to balance disk usage and load?
- Shard allocation awareness
- Cluster reroute API
- Automatic shard rebalancing (Correct answer)
- Shrink API
Correct answer: Automatic shard rebalancing
Elasticsearch automatically rebalances shards across nodes to maintain an even distribution of data and load when nodes join or leave the cluster.
Question 2: What does the '_source' field in an Elasticsearch document contain?
- Only the indexed fields used for search
- The original JSON document body as provided at index time (Correct answer)
- The Lucene segment metadata
- The routing hash for shard assignment
Correct answer: The original JSON document body as provided at index time
The _source field stores the original JSON document exactly as it was indexed, enabling retrieval and partial updates without re-indexing.
Question 3: Which Elasticsearch query type allows you to find documents where a field value falls between a minimum and maximum value?
- match
- term
- range (Correct answer)
- prefix
Correct answer: range
The range query finds documents where a field value falls within specified bounds using operators like gte, lte, gt, and lt.
Question 4: What is a 'hot-warm' architecture in Elasticsearch used for?
- Separating real-time indexing nodes from nodes holding older, less-queried data (Correct answer)
- Separating master nodes from data nodes
- Balancing read and write traffic across the cluster
- Routing queries to geographically closer nodes
Correct answer: Separating real-time indexing nodes from nodes holding older, less-queried data
A hot-warm architecture uses high-performance 'hot' nodes for recent active data and cheaper 'warm' nodes for older, infrequently accessed historical data.
Question 5: Which Elasticsearch feature allows you to automatically roll over to a new index when an index reaches a certain size, document count, or age?
- Shrink API
- Rollover API (Correct answer)
- Reindex API
- Split API
Correct answer: Rollover API
The Rollover API creates a new index for a data stream or index alias when the current index reaches configured thresholds like max_age, max_docs, or max_size.
Question 6: In Elasticsearch, what does the 'should' clause in a bool query do when no 'must' or 'filter' clauses are present?
- Acts as a required condition; documents must match at least one should clause (Correct answer)
- Documents matching should clauses receive a boost but no minimum match is required
- Should clauses are completely ignored in scoring
- Should clauses are treated identically to filter clauses
Correct answer: Acts as a required condition; documents must match at least one should clause
When a bool query contains only 'should' clauses (no must/filter), at least one should clause must match, controlled by minimum_should_match (defaults to 1).
Question 7: Which Elasticsearch API can you use to check the health of a cluster and get a color-coded status?
- _stats API
- _cluster/health API (Correct answer)
- _nodes/stats API
- _cat/indices API
Correct answer: _cluster/health API
The _cluster/health API returns the cluster's health status as green (all shards assigned), yellow (all primaries assigned, some replicas unassigned), or red (some primaries unassigned).
Which Elasticsearch mechanism automatically moves shards between nodes to balance disk usage and load?