ElasticSearch Technology & Digital Applications 5 — Questions and Answers
Question 1: What is the purpose of the '_reindex' API in Elasticsearch?
- To rebuild the inverted index from raw data
- To copy documents from one index to another, optionally transforming them (Correct answer)
- To reset shard assignments to default values
- To regenerate the cluster state metadata
Correct answer: To copy documents from one index to another, optionally transforming them
The _reindex API copies documents from a source index to a destination index, allowing you to apply new mappings, settings, or transformations.
Question 2: Which Elasticsearch concept describes the process of breaking text into tokens during indexing?
- Sharding
- Analysis (Correct answer)
- Segmentation
- Normalization
Correct answer: Analysis
Analysis is the process of converting text into tokens (terms) using character filters, tokenizers, and token filters defined in an analyzer.
Question 3: What does the 'search_after' parameter in Elasticsearch provide?
- Post-query result filtering based on a score threshold
- Efficient deep pagination using the last result's sort values as a cursor (Correct answer)
- A way to cache search results for repeated queries
- Sorting results after aggregations are applied
Correct answer: Efficient deep pagination using the last result's sort values as a cursor
search_after enables efficient pagination by using sort values from the last returned document as a cursor, avoiding the performance penalties of deep from/size pagination.
Question 4: In Elasticsearch, what is the 'split brain' problem?
- When a shard's primary and replica go out of sync
- When network partition causes multiple nodes to independently elect themselves as master (Correct answer)
- When queries return inconsistent results across replicas
- When field mappings conflict between index segments
Correct answer: When network partition causes multiple nodes to independently elect themselves as master
Split brain occurs when a cluster is partitioned and multiple nodes each believe they are the master, potentially causing data inconsistency.
Question 5: Which Elasticsearch feature would you use to search for documents where a field value falls within a specific date range?
- match query with date format
- range query on a date field (Correct answer)
- wildcard query with date pattern
- fuzzy query with date tolerance
Correct answer: range query on a date field
The range query with gte, lte, gt, or lt parameters on a date field allows filtering documents by date ranges, supporting various date math expressions.
Question 6: What is the purpose of the Elasticsearch 'circuit breaker'?
- To automatically failover to replica shards when primaries fail
- To prevent operations from consuming too much memory and causing OutOfMemoryErrors (Correct answer)
- To rate-limit incoming indexing requests during high load
- To isolate network partitions between cluster nodes
Correct answer: To prevent operations from consuming too much memory and causing OutOfMemoryErrors
Circuit breakers track memory usage for specific operations and throw exceptions when estimated memory would exceed configured limits, preventing JVM crashes.
Question 7: What does the 'force merge' API do in Elasticsearch?
- Forces a cluster state update across all nodes
- Merges Lucene segments in an index, reducing their count and reclaiming deleted document space (Correct answer)
- Combines multiple indices into a single index
- Forces a shard rebalance across all nodes
Correct answer: Merges Lucene segments in an index, reducing their count and reclaiming deleted document space
Force merge reduces the number of Lucene segments in an index by merging smaller ones, which frees disk space from deleted documents and can improve query performance.
What is the purpose of the '_reindex' API in Elasticsearch?