Skip to main content
InterviewHubPRO
Section Overview
Q37

Question 37 of 50

Part 3: Advanced Internals, Scale & Production Patterns (Senior / Lead)

74%
Elasticsearch & Lucene (50 Qs)•Part 3: Advanced Internals, Scale & Production Patterns (Senior / Lead)

Doc Values vs Fielddata: Memory tradeoffs, column-oriented storage, and sorting/aggregations architecture.

senior LevelMost AskedSystem DesignAlgorithms

In Simple Words: The inverted index is optimized for search ("find documents matching 'kubernetes'"), but terrible for sorting or aggregations ("group by category and calculate average price"):

  • Doc Values: On-disk, column-oriented data structure built at index time for non-analyzed fields (keyword, numeric, date). Uses the OS Page Cache, preventing JVM Heap bloat and OOM crashes.
  • Fielddata: In-memory data structure built dynamically on first query for analyzed text fields. High memory usage; dangerous in production without strict circuit breakers.