ElasticSearch ElasticSearch MCQ 3 — Questions and Answers
Question 1: Which Elasticsearch API allows you to perform multiple index, update, delete, or create operations in a single request?
- Multi Search API (_msearch)
- Bulk API (_bulk) (Correct answer)
- Reindex API (_reindex)
- Update By Query API (_update_by_query)
Correct answer: Bulk API (_bulk)
The Bulk API (_bulk) accepts multiple operations (index, create, update, delete) in a single HTTP request, significantly reducing network overhead.
Question 2: In Elasticsearch, what is a 'pipeline' in the context of ingest nodes?
- A sequence of processors that transform documents before indexing (Correct answer)
- A replication strategy for primary and replica shards
- A routing mechanism for cross-cluster searches
- A configuration for index lifecycle management stages
Correct answer: A sequence of processors that transform documents before indexing
An ingest pipeline is a sequence of processors (e.g., grok, set, rename) that transform and enrich documents before they are indexed.
Question 3: What does the 'term' query in Elasticsearch search for?
- Analyzed terms using full-text analysis
- The exact value in a field without any analysis (Correct answer)
- Terms within a specified edit distance
- Terms matching a wildcard pattern
Correct answer: The exact value in a field without any analysis
The term query searches for an exact, unanalyzed value in a field and is best used against keyword, numeric, or date fields.
Question 4: Which index setting controls the number of replica shards for an Elasticsearch index?
- index.number_of_shards
- index.number_of_replicas (Correct answer)
- index.auto_expand_replicas
- index.shard_count
Correct answer: index.number_of_replicas
The 'index.number_of_replicas' setting defines how many replica copies of each primary shard to maintain, which can be changed at runtime.
Question 5: What is the 'split brain' problem in distributed Elasticsearch clusters?
- When two nodes disagree on the mapping of a field
- When the cluster splits into two groups each thinking they are the master (Correct answer)
- When a primary and replica shard go out of sync
- When a node runs out of heap memory and drops segments
Correct answer: When the cluster splits into two groups each thinking they are the master
Split brain occurs when network partitioning causes two sub-clusters to each elect their own master, potentially causing data inconsistency.
Question 6: Which Elasticsearch query would you use to search across multiple fields and boost one field's relevance more than another?
- match
- term
- multi_match with field boosting using the ^ operator (Correct answer)
- query_string
Correct answer: multi_match with field boosting using the ^ operator
The multi_match query with field boosting (e.g., 'fields': ['title^3', 'body']) searches multiple fields and assigns higher relevance weight to boosted fields.
Question 7: In Elasticsearch Index Lifecycle Management (ILM), which phase is typically used to delete indices after a retention period?
- Hot
- Warm
- Cold
- Delete (Correct answer)
Correct answer: Delete
The Delete phase in ILM is the final lifecycle phase where an index is permanently deleted, typically configured with a minimum age trigger.
Which Elasticsearch API allows you to perform multiple index, update, delete, or create operations in a single request?