Elasticsearch medium
What is the primary role of the `_source` field in the underlying Elasticsearch storage architecture?
- A It stores the IP address and identity of the user who indexed the document.
- B It is a stored copy of the original JSON document, held separately from the inverted index, used for retrieval during searches or re-indexing.
- C It is a temporary buffer for data while it is waiting to be analyzed.
- D It is a checksum used to verify data integrity across replicas.
Answer: B. It is a stored copy of the original JSON document, held separately from the inverted index, used for retrieval during searches or re-indexing.
The Inverted Index is great for finding *if* a word exists, but it's terrible at reconstructing the original document. `_source` is your backup; it's the raw data. If you disable it, you can still search the index, but you can't get your original JSON back from the API.
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?