Elasticsearch easy
Elasticsearch achieves high-speed full-text search by using which core data structure to map tokens to document IDs?
- A A B-Tree index commonly found in relational databases.
- B A Bloom Filter used for membership testing.
- C An Inverted Index, similar to the index found at the back of a library book.
- D A circular buffer for temporary data storage.
Answer: C. An Inverted Index, similar to the index found at the back of a library book.
An Inverted Index stores a list of every unique word and the documents that contain them. When you search for 'Fox', Elasticsearch doesn't scan your docs; it looks up 'Fox' in the index and immediately finds the document IDs, leading to sub-millisecond search performance.
One system design question a day, with spaced repetition so the ones you miss come back.
Get the appRelated questions
- What are the two primary reasons for configuring one or more 'Replica Shards' for an index?
- When a String field is mapped as `text`, what process is performed to enable full-text search capability?
- What is the primary benefit of splitting an Elasticsearch index into multiple 'Primary Shards'?
- Every document stored in an Elasticsearch index is uniquely tracked by which mandatory metadata field?
- Elasticsearch search results include a metadata field called `_score`. What does this value primarily indicate?
- What is the primary architectural purpose of Elasticsearch in a modern software stack?