1. Which library provides the core indexing and scoring inside Elasticsearch?
- RocksDB
- Apache Kafka
- Apache Lucene
- Apache Spark
Show answer
Answer: Apache Lucene
Each Elasticsearch shard is a Lucene index.
Lesson: What Elasticsearch Is
25 questions from the Elasticsearch course, each with the correct answer and an explanation. Try to answer before you open the answer.
Answer: Apache Lucene
Each Elasticsearch shard is a Lucene index.
Lesson: What Elasticsearch Is
Answer: Each term to the documents that contain it
Looking up a term returns its postings list directly.
Lesson: The Inverted Index
Answer: number_of_replicas
Replica count is dynamic; primary count is fixed at creation.
Answer: Newline-delimited JSON with action and source lines
NDJSON lets the coordinating node split the request without parsing it as one big document.
Lesson: Document CRUD and the Bulk API
Answer: keyword
keyword stores the exact value and supports aggregations via doc values.
Answer: Create a new index with the new mapping and reindex the data
Existing field types cannot be changed in place.
Answer: Exactly one
Character and token filters are optional and can be many; the tokenizer is required and single.
Lesson: How Analyzers Work
Answer: The synonym list can be updated without reindexing documents
Search-time synonyms change queries, not stored terms.
Answer: Run _analyze on both the document text and the query text with the field's analyzers
Comparing produced terms reveals analysis mismatches.
Lesson: Debugging With the _analyze API
Answer: match_phrase
match_phrase uses term positions; slop relaxes adjacency.
Answer: In filter, using a term query
Filter context is exact, unscored and cacheable.
Answer: A term that is rare across the index
Inverse document frequency rewards rare terms; filters do not score.
Answer: Each shard returns only its own top terms before results are merged
shard_size and doc_count_error_upper_bound address this.
Answer: An approximate count of distinct values
It uses HyperLogLog++ with a precision_threshold.
Answer: Only the returned hits, not the aggregations
Aggregations are computed before post_filter is applied.
Lesson: Faceted Search With post_filter
Answer: search_after with a point in time
It avoids collecting from + size hits on every shard.
Lesson: Pagination: from/size, search_after and Point in Time
Answer: multi_match with type bool_prefix over the field and its n-gram sub-fields
bool_prefix treats the last term as a prefix.
Lesson: Highlighting and Autocomplete
Answer: Improves recall at the cost of more work per shard
More candidates are explored in the HNSW graph.
Answer: Yellow, because replicas cannot be placed on the node holding the primary
All primaries are assigned but replicas are not.
Answer: @timestamp
Data streams are designed for time-series, append-only data.
Lesson: Aliases, ILM and Data Streams
Answer: The remove and add actions apply atomically, so clients never see no index
Atomic alias updates make the cutover seamless.
Answer: Disabling refresh and replicas during the load, then restoring them
Fewer refreshes and no replication during the load reduce work.
Lesson: Performance Tuning
Answer: Through a backend that builds queries and calls a private cluster with a least-privilege API key
Keep the cluster private and the credentials server-side.
Lesson: Security
Answer: A failure between the two writes leaves the database and the index inconsistent
Outbox or CDC ties index updates to committed database changes.
Answer: Applications access indices through aliases so reindexing does not need downtime
Aliases make migrations routine.