ElasticSearch Trivia 4 — Questions and Answers
Question 1: What is the name of the relevance scoring algorithm Elasticsearch uses by default?
- TF-IDF only
- BM25 (Correct answer)
- Okapi-Classic
- Cosine Similarity
Correct answer: BM25
Elasticsearch uses BM25 (Best Match 25) as its default relevance scoring algorithm, replacing TF-IDF since version 5.0.
Question 2: In Elasticsearch, what is a 'replica shard'?
- A backup copy of a primary shard (Correct answer)
- A shard on a remote cluster
- A read-only archive shard
- A shard used only for aggregations
Correct answer: A backup copy of a primary shard
A replica shard is an exact copy of a primary shard, providing redundancy for data loss protection and additional read capacity.
Question 3: What Elasticsearch feature enables searching across multiple clusters from a single query?
- Multi-index search
- Cross-Cluster Search (CCS) (Correct answer)
- Federation Search
- Cluster Mesh
Correct answer: Cross-Cluster Search (CCS)
Cross-Cluster Search (CCS) allows a coordinating cluster to send search requests to and aggregate results from remote Elasticsearch clusters.
Question 4: Which HTTP method is used to update an existing document in Elasticsearch using the Update API?
- PUT
- PATCH
- POST (Correct answer)
- GET
Correct answer: POST
The Elasticsearch Update API uses a POST request to the '/_update' endpoint to partially update a document.
Question 5: What does the 'refresh_interval' setting control in Elasticsearch?
- How often snapshots are taken
- How often indexed documents become searchable (Correct answer)
- How often node stats are collected
- How often ILM policies run
Correct answer: How often indexed documents become searchable
The 'refresh_interval' controls how often Elasticsearch performs a refresh, making newly indexed documents visible to search.
Question 6: What is the purpose of the Elasticsearch 'explain' API parameter?
- To show query execution plan like SQL EXPLAIN
- To provide a human-readable description of how a score was computed (Correct answer)
- To list all matching documents
- To debug mapping conflicts
Correct answer: To provide a human-readable description of how a score was computed
The 'explain' parameter returns a detailed breakdown of how the relevance score for each document was calculated.
Question 7: What Elasticsearch abstraction allows you to point multiple indices under a single name for transparent index management?
- Data stream
- Alias (Correct answer)
- View
- Rollup index
Correct answer: Alias
An alias is a secondary name that can point to one or more indices, enabling zero-downtime reindexing and simplified client configuration.
What is the name of the relevance scoring algorithm Elasticsearch uses by default?